Minor fixes and new warning for outdated "app" version.

This commit is contained in:
Scott Idem
2024-06-26 14:06:38 -04:00
parent 7faa9d0459
commit dd9c48e801
4 changed files with 45 additions and 6 deletions

View File

@@ -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 &amp; DB &amp; Reload
</button>
</div>
{/if}
<slot></slot>