diff --git a/src/lib/app_components/e_app_sys_bar.svelte b/src/lib/app_components/e_app_sys_bar.svelte index 55dba955..4157a501 100644 --- a/src/lib/app_components/e_app_sys_bar.svelte +++ b/src/lib/app_components/e_app_sys_bar.svelte @@ -15,7 +15,10 @@ import { Bug, CircleX, + // DatabaseMinus, + // DatabaseX, Eraser, + ListX, Lock, // LockKeyhole, LogOut, @@ -80,8 +83,24 @@ function toggle_theme_mode() { // DOM sync (class) is handled reactively in +layout.svelte effect #3 } +// ── Dev: clear IDB only — preserves localStorage/sessionStorage (auth state, prefs) ── +async function handle_clear_idb_only() { + if ( + !confirm( + 'Clear all IndexedDB databases then reload? localStorage and sessionStorage will be preserved.' + ) + ) + return; + const db_list = await indexedDB.databases(); + console.log('[clear_idb] IDB databases found:', db_list.map((d) => d.name)); + for (const db of db_list) { + if (db.name) indexedDB.deleteDatabase(db.name); + } + window.location.reload(); +} + // ── Dev: clear all browser storage + all IndexedDB databases, then reload ── -async function handle_clear_storage_db() { +async function handle_clear_storage_and_idb() { if ( !confirm( 'FULL RESET: Delete ALL IndexedDB databases, clear localStorage and sessionStorage, then reload? This cannot be undone.' @@ -289,6 +308,22 @@ function apply_theme(value: string) { Not signed in {/if} + + + + +