Making things look better. Now with a person look up for the presenter record. Wrapping up for the day.

This commit is contained in:
Scott Idem
2024-06-26 18:19:17 -04:00
parent 4d7e48a170
commit 20e1c46461
4 changed files with 239 additions and 20 deletions

View File

@@ -111,33 +111,61 @@ $: 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>
{#if $ae_loc.ver != '2024-06-26_13' || $ae_loc.ver_idb != '2024-06-26_1625'}
<div class="flex flex-col items-center justify-center bg-error-100 text-error-800 p-4 rounded-lg shadow-lg space-y-2 my-4 w-full">
<span class="fas fa-exclamation-triangle text-4xl text-error-800"></span>
<h2 class="text-2xl font-bold">New Version Available</h2>
<p class="text-lg max-w-2xl text-center">
There is a new version of the web app (this website). Please use the button to clear some cached data and settings. The page will then reload.
</p>
<button
class="btn btn-xl variant-ghost-error"
class="btn btn-xl variant-ghost-success hover:variant-filled-success"
on:click={() => {
if (!confirm('Are you sure you want to clear the local and session storage?')) {
return false;
// This is not a very efficient way to do this, but it works for now.
// Do this first even if the localStorage will be cleared.
if ($ae_loc.ver_idb != '2024-06-26_1625') {
// Yep... this needs to be done differently.
$ae_loc.ver_idb = '2024-06-26_1625';
}
// Clear the local and session storage
localStorage.clear();
sessionStorage.clear();
if ($ae_loc.ver != '2024-06-26_13') {
alert('You will need to sign in again.')
// Clear the local and session storage. Clearing the localStorage will force it to be re-created.
localStorage.clear();
sessionStorage.clear();
}
// Clear Indexed DB as well
indexedDB.deleteDatabase('ae_core_db');
indexedDB.deleteDatabase('ae_events_db');
window.location.reload();
window.location.reload(true); // true only works with Firefox
// 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
<!-- <span class="fas fa-eraser mx-1"></span> -->
<span class="fas fa-sync mx-1"></span>
Clear App Data &amp; Settings - Reload
</button>
{#if $ae_loc.ver != '2024-06-26_13'}
<p class="text-lg font-bold max-w-2xl text-center">
You will need to sign in again after clearing the cache.
</p>
{/if}
<!-- <p>This reload will be done automatically in the future.</p> -->
</div>
{:else}
<!-- <div class="flex flex-col items-center justify-center bg-success-100 text-success-800 p-4 rounded-lg shadow-lg space-y-2 my-4 w-full">Local App Version {$ae_loc.ver}<br>Local App DB Version {$ae_loc.ver_idb}</div> -->
{/if}
<slot></slot>