Recovering from something that broke the styling. It is not 100% right, but much better.
This commit is contained in:
@@ -5,16 +5,16 @@ export let data: any;
|
||||
// Imports
|
||||
import { browser } from '$app/environment';
|
||||
import { goto } from '$app/navigation';
|
||||
import { onMount } from 'svelte';
|
||||
import type { Writable } from 'svelte/store';
|
||||
import { localStorageStore } from '@skeletonlabs/skeleton';
|
||||
// import { onMount } from 'svelte';
|
||||
// import type { Writable } from 'svelte/store';
|
||||
// import { localStorageStore } from '@skeletonlabs/skeleton';
|
||||
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
// import { ae_util } from '$lib/ae_utils';
|
||||
import { api } from '$lib/api';
|
||||
// import { api } from '$lib/api';
|
||||
import { ae_loc, ae_sess, ae_api, slct } from '$lib/ae_stores';
|
||||
import { events_loc, events_slct, events_trigger, events_trig_kv } from '$lib/ae_events_stores';
|
||||
import { events_func } from '$lib/ae_events_functions';
|
||||
import { events_loc, events_sess, events_slct, events_trigger, events_trig_kv } from '$lib/ae_events_stores';
|
||||
// import { events_func } from '$lib/ae_events_functions';
|
||||
|
||||
// import Element_data_store from '$lib/element_data_store.svelte';
|
||||
|
||||
@@ -43,12 +43,41 @@ $events_slct.event_obj_li = ae_acct.slct.event_obj_li;
|
||||
|
||||
let ae_promises: key_val = {};
|
||||
|
||||
|
||||
onMount(() => {
|
||||
if (browser) {
|
||||
console.log('Events - Presentation Management: +layout.svelte');
|
||||
|
||||
console.log($events_slct.event_obj_li);
|
||||
});
|
||||
|
||||
// if ($ae_loc.ver != $ae_sess.ver || $ae_loc.ver_idb != $ae_sess.ver_idb || $events_loc.ver != $events_sess.ver|| $events_loc.ver_idb != $events_sess.ver_idb) {
|
||||
// console.log('New version available!!!');
|
||||
// console.log(`$ae_loc.ver: ${$ae_loc.ver} != $ae_sess.ver: ${$ae_sess.ver}`);
|
||||
// console.log(`$ae_loc.ver_idb: ${$ae_loc.ver_idb} != $ae_sess.ver_idb: ${$ae_sess.ver_idb}`);
|
||||
// console.log(`$events_loc.ver: ${$events_loc.ver} != $events_sess.ver: ${$events_sess.ver}`);
|
||||
// console.log(`$events_loc.ver_idb: ${$events_loc.ver_idb} != $events_sess.ver_idb: ${$events_sess.ver_idb}`);
|
||||
|
||||
// // alert('New version available!!!');
|
||||
|
||||
// // Clear Indexed DB as well
|
||||
// indexedDB.deleteDatabase('ae_core_db');
|
||||
// indexedDB.deleteDatabase('ae_events_db');
|
||||
|
||||
// localStorage.removeItem('ae_loc');
|
||||
// localStorage.removeItem('events_loc');
|
||||
// localStorage.clear();
|
||||
|
||||
// sessionStorage.removeItem('ae_sess');
|
||||
// sessionStorage.removeItem('events_sess');
|
||||
// sessionStorage.clear();
|
||||
|
||||
|
||||
// // This does not seem to work fast enough or something?
|
||||
// goto('/', {replaceState: true, invalidateAll: true});
|
||||
|
||||
|
||||
// localStorage.removeItem('ae_loc');
|
||||
// localStorage.removeItem('events_loc');
|
||||
// localStorage.clear();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
// Updated 2024-06-25
|
||||
@@ -122,66 +151,6 @@ onMount(() => {
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
{#if $ae_loc.ver != '2024-08-16_1821' || $ae_loc.ver_idb != '2024-08-16_1826'}
|
||||
|
||||
<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-success hover:variant-filled-success"
|
||||
on:click={() => {
|
||||
// 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-08-16_1826') {
|
||||
// Yep... this needs to be done differently.
|
||||
$ae_loc.ver_idb = '2024-08-16_1826';
|
||||
}
|
||||
|
||||
if ($ae_loc.ver != '2024-08-16_1821') {
|
||||
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');
|
||||
|
||||
// This does not seem to work fast enough or something?
|
||||
goto('/', {invalidateAll: true});
|
||||
|
||||
// The page does usually seem to reload correctly?
|
||||
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> -->
|
||||
<span class="fas fa-sync mx-1"></span>
|
||||
Clear App Data & Settings - Reload
|
||||
</button>
|
||||
{#if $ae_loc.ver != '2024-08-07_1504'}
|
||||
<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}
|
||||
|
||||
<!-- <div class="container m-auto"> -->
|
||||
<slot></slot>
|
||||
<!-- </div> -->
|
||||
|
||||
@@ -121,7 +121,7 @@ onMount(() => {
|
||||
|
||||
<svelte:head>
|
||||
<title>
|
||||
Session: {ae_util.shorten_string({string: $lq__event_session_obj?.name, max_length: 12})} ({$lq__event_session_obj?.event_session_id}) - Pres Mgmt - {$events_loc?.title}
|
||||
Session: {ae_util.shorten_string({string: $lq__event_session_obj?.name ?? 'Loading...', max_length: 12})} ({$lq__event_session_obj?.event_session_id ?? ''}) - Pres Mgmt - {$events_loc?.title}
|
||||
</title>
|
||||
</svelte:head>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user