Bug fixes for loading the IDAA Rec Mtg when navigating. Other improvements.

This commit is contained in:
Scott Idem
2025-07-09 11:46:27 -04:00
parent 6bdedecfd8
commit 628659f348
4 changed files with 98 additions and 43 deletions

View File

@@ -10,16 +10,15 @@ import { onDestroy } from "svelte";
import { browser } from '$app/environment';
// *** Import other supporting libraries
import { Modal } from 'flowbite-svelte';
// import { Modal } from 'flowbite-svelte';
import { liveQuery } from "dexie";
// *** Import Aether specific variables and functions
import { ae_util } from '$lib/ae_utils/ae_utils';
import { db_posts } from "$lib/ae_posts/db_posts";
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
import { db_posts } from "$lib/ae_posts/db_posts";
// import { posts_func } from '$lib/ae_posts/ae_posts_functions';
import { idaa_loc, idaa_sess, idaa_slct, idaa_trig, idaa_prom } from '$lib/ae_idaa_stores';
import { posts_func } from '$lib/ae_posts/ae_posts_functions';
import Comp__post_obj_id_edit from '.././ae_idaa_comp__post_obj_id_edit.svelte';
import Comp__post_obj_id_view from '.././ae_idaa_comp__post_obj_id_view.svelte';
@@ -47,6 +46,9 @@ let lq__post_obj = $derived(liveQuery(async () => {
if ($idaa_slct.post_obj && results) {
if (JSON.stringify($idaa_slct.post_obj) !== JSON.stringify(results)) {
$idaa_slct.post_obj = { ...results};
if (log_lvl) {
console.log(`$idaa_slct.post_obj = `, $idaa_slct.post_obj);
}
} else {
if (log_lvl) {
console.log(`Post object has not changed for post_id: ${$idaa_slct.post_id}`);
@@ -54,7 +56,6 @@ let lq__post_obj = $derived(liveQuery(async () => {
}
}
// console.log(`$idaa_slct.post_obj = `, $idaa_slct.post_obj);
return results;
}));
@@ -107,9 +108,9 @@ onDestroy(() => {
<svelte:head>
<title>
IDAA Bulletin Board:
IDAA BB:
{$lq__post_obj?.name ? ae_util.shorten_string({ string: $lq__post_obj?.name, max_length: 20, begin_length: 10, end_length: 4 }) : ''}
- Novi - {$ae_loc?.name}
- Novi - {$ae_loc?.title}
</title>
</svelte:head>
@@ -162,11 +163,15 @@ onDestroy(() => {
"
>
<a href="/idaa/bb" class="novi_btn btn btn-secondary btn-sm
preset-tonal-tertiary border border-tertiary-500
hover:preset-filled-tertiary-500
transition
">
<a
href="/idaa/bb"
class="
novi_btn btn btn-secondary btn-sm
preset-tonal-tertiary border border-tertiary-500
hover:preset-filled-tertiary-500
transition
"
>
<span class="fas fa-arrow-left m-1"></span> Back to Posts List
<!-- <span class="fas fa-times m-1"></span> View Other Meetings -->
</a>

View File

@@ -12,12 +12,14 @@ let {
}: Props = $props();
// *** Import Svelte specific
// import { createEventDispatcher, onDestroy, onMount } from 'svelte';
// import { onDestroy, onMount } from 'svelte';
import { fade } from 'svelte/transition';
import { browser } from '$app/environment';
import { goto } from '$app/navigation';
// *** Import Aether core variables and functions
// *** Import other supporting libraries
// *** Import Aether specific variables and functions
import type { key_val } from '$lib/ae_stores';
import { ae_util } from '$lib/ae_utils/ae_utils';
import { core_func } from '$lib/ae_core/ae_core_functions';
@@ -34,6 +36,7 @@ import Comp_hosted_files_upload from '$lib/ae_core/ae_comp__hosted_files_upload.
if (!$idaa_slct.post_obj) {
$idaa_slct.post_obj = {};
}
// Create a copy of the post object
let orig_post_obj: any = { ...$idaa_slct.post_obj };
if (browser) {
// console.log(`$lq__post_obj = `, $lq__post_obj);