feat(settings): separate toasts and system notifications toggles
- Split "Notifications" setting into "In-app Toasts" and "System Notifications" - In-app toasts control the toast messages within the app - System notifications control desktop notifications on track change - Both settings persist to localStorage and load on app startup - Migrates old 'qbz-notifications-enabled' key to new 'qbz-toasts-enabled' feat(library): add stop scanning button - Add library_stop_scan command in Rust backend - Add cancel flag (AtomicBool) to LibraryState - Check cancel flag during scan loop for both CUE and audio files - Add "Cancelled" status to ScanStatus enum - Add stop button in LocalLibraryView scan progress UI - Button appears red on hover for clear visibility cc
This commit is contained in:
1 parent
7c42395598
commit
b8e3bca6f8
9 files changed
+149
-27
No files matched your search
@@ -17,10 +17,15 @@
|
||||
import { clearCache as clearLyricsCache } from '$lib/stores/lyricsStore';
|
||||
import { getDevicePrettyName } from '$lib/utils/audioDeviceNames';
|
||||
import {
|
||||
getNotificationsEnabled,
|
||||
setNotificationsEnabled,
|
||||
loadNotificationsPreference
|
||||
getToastsEnabled,
|
||||
setToastsEnabled,
|
||||
loadToastsPreference
|
||||
} from '$lib/stores/toastStore';
|
||||
import {
|
||||
getSystemNotificationsEnabled,
|
||||
setSystemNotificationsEnabled,
|
||||
loadSystemNotificationsPreference
|
||||
} from '$lib/services/playbackService';
|
||||
|
||||
interface Props {
|
||||
onBack?: () => void;
|
||||
@@ -143,7 +148,8 @@
|
||||
// Appearance settings
|
||||
let theme = $state('Dark');
|
||||
let compactMode = $state(false);
|
||||
let notificationsEnabled = $state(true);
|
||||
let toastsEnabled = $state(true);
|
||||
let systemNotificationsEnabled = $state(true);
|
||||
let language = $state('Auto');
|
||||
|
||||
// Last.fm integration state
|
||||
@@ -216,9 +222,11 @@
|
||||
// Load API keys state
|
||||
loadApiKeysState();
|
||||
|
||||
// Load notifications preference
|
||||
loadNotificationsPreference();
|
||||
notificationsEnabled = getNotificationsEnabled();
|
||||
// Load notification preferences
|
||||
loadToastsPreference();
|
||||
toastsEnabled = getToastsEnabled();
|
||||
loadSystemNotificationsPreference();
|
||||
systemNotificationsEnabled = getSystemNotificationsEnabled();
|
||||
});
|
||||
|
||||
async function loadLastfmState() {
|
||||
@@ -854,9 +862,13 @@
|
||||
<span class="setting-label">Compact Mode</span>
|
||||
<Toggle enabled={compactMode} onchange={(v) => (compactMode = v)} />
|
||||
</div>
|
||||
<div class="setting-row">
|
||||
<span class="setting-label">In-app Toasts</span>
|
||||
<Toggle enabled={toastsEnabled} onchange={(v) => { toastsEnabled = v; setToastsEnabled(v); }} />
|
||||
</div>
|
||||
<div class="setting-row last">
|
||||
<span class="setting-label">Notifications</span>
|
||||
<Toggle enabled={notificationsEnabled} onchange={(v) => { notificationsEnabled = v; setNotificationsEnabled(v); }} />
|
||||
<span class="setting-label">System Notifications</span>
|
||||
<Toggle enabled={systemNotificationsEnabled} onchange={(v) => { systemNotificationsEnabled = v; setSystemNotificationsEnabled(v); }} />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in new issue
Block a user