Minor fixes and new warning for outdated "app" version.
This commit is contained in:
@@ -8,7 +8,7 @@ import type { key_val } from '$lib/ae_stores';
|
||||
// Longer-term app data. This should be stored to *local* storage.
|
||||
// Updated 2024-03-06
|
||||
let events_local_data_struct: key_val = {
|
||||
'ver': '2024-06-11_11',
|
||||
'ver': '2024-06-26_12',
|
||||
// Shared
|
||||
'name': 'Aether - Events (SvelteKit 2.x Svelte 4.x)',
|
||||
'title': `OSIT's Æ Events`, // - Dev SvelteKit`, // Æ
|
||||
|
||||
@@ -36,7 +36,7 @@ export type key_val = {
|
||||
|
||||
// *** BEGIN *** Longer-term app data. This should be stored to local storage.
|
||||
export let ae_app_local_data_struct: key_val = {
|
||||
'ver': '2024-06-25_14',
|
||||
'ver': '2024-06-26_12',
|
||||
'name': 'Aether - App Hub (SvelteKit 2.x Svelte 4.x)',
|
||||
'theme': 'light',
|
||||
'iframe': false,
|
||||
|
||||
@@ -229,7 +229,8 @@ function dispatch_something_changed() {
|
||||
}}
|
||||
>
|
||||
<span class="fas fa-sync mx-1"></span>
|
||||
Reload and
|
||||
Reload
|
||||
&
|
||||
<span class="fas fa-trash mx-1"></span>
|
||||
Clear Cache
|
||||
</button>
|
||||
@@ -237,14 +238,24 @@ function dispatch_something_changed() {
|
||||
class="btn btn-sm variant-glass-warning"
|
||||
title="Clear the browser storage for this page"
|
||||
on:click={() => {
|
||||
// $ae_loc.
|
||||
if (!confirm('Are you sure you want to clear the local and session storage?')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the local and session storage
|
||||
localStorage.clear();
|
||||
sessionStorage.clear();
|
||||
alert('Local and Session Storage cleared. You will probably want to refresh the page.');
|
||||
|
||||
// Clear Indexed DB as well
|
||||
indexedDB.deleteDatabase('ae_core_db');
|
||||
indexedDB.deleteDatabase('ae_events_db');
|
||||
|
||||
window.location.reload();
|
||||
// alert('Local and Session Storage cleared and Indexed DBs deleted. You will probably want to refresh the page.');
|
||||
}}
|
||||
>
|
||||
<span class="fas fa-eraser mx-1"></span>
|
||||
Clear Storage
|
||||
Clear Storage & DB
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -111,5 +111,33 @@ $: if ($events_trigger == 'load__event_session_obj_id' && $events_trig_kv['event
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
{#if $ae_loc.ver < '2024-06-26_12'}
|
||||
<div class="flex flex-col items-center justify-center bg-error-100 text-error-800 p-4 rounded-lg shadow-lg my-4 w-full">
|
||||
<p>There is a new version of the app. Please use the button to clear the page cache and reload the page.</p>
|
||||
<button
|
||||
class="btn btn-xl variant-ghost-error"
|
||||
on:click={() => {
|
||||
if (!confirm('Are you sure you want to clear the local and session storage?')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the local and session storage
|
||||
localStorage.clear();
|
||||
sessionStorage.clear();
|
||||
|
||||
// Clear Indexed DB as well
|
||||
indexedDB.deleteDatabase('ae_core_db');
|
||||
indexedDB.deleteDatabase('ae_events_db');
|
||||
|
||||
window.location.reload();
|
||||
// alert('Local and Session Storage cleared and Indexed DBs deleted. You will probably want to refresh the page.');
|
||||
}}
|
||||
title="New Version: Clear the browser storage for this page"
|
||||
>
|
||||
<span class="fas fa-eraser mx-1"></span>
|
||||
Clear Storage & DB & Reload
|
||||
</button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<slot></slot>
|
||||
|
||||
Reference in New Issue
Block a user