Package updates and trying to fix a reversion with reactivity within the same page file. The Dexie liveQuery does not seem to refresh correctly when on the same page. It does show the update on child components. Even if nearly identical.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
/** @type {import('./$types').PageData} */
|
||||
let log_lvl: number = 0;
|
||||
let log_lvl: number = 1;
|
||||
|
||||
// *** Import Svelte specific
|
||||
import { browser } from '$app/environment';
|
||||
@@ -25,7 +25,8 @@ import Archive_view from './ae_idaa_comp__archive_obj_id_view.svelte';
|
||||
|
||||
import Archive_content_obj_li from './ae_idaa_comp__archive_content_obj_li.svelte';
|
||||
import Archive_content_obj_id_edit from './ae_idaa_comp__archive_content_obj_id_edit.svelte';
|
||||
import Media_player from './../ae_idaa_comp__media_player.svelte';
|
||||
// import Media_player from './../ae_idaa_comp__media_player.svelte';
|
||||
import Modal_media_player from './ae_idaa_comp__modal_media_player.svelte';
|
||||
|
||||
interface Props {
|
||||
data: any;
|
||||
@@ -50,7 +51,9 @@ $idaa_slct.archive_id = ae_acct.slct.archive_id;
|
||||
|
||||
|
||||
let lq__archive_obj = $derived(liveQuery(async () => {
|
||||
console.log(`lq__archive_obj: archive_id = ${$idaa_slct?.archive_id}`);
|
||||
if (log_lvl) {
|
||||
console.log(`lq__archive_obj: archive_id = ${$idaa_slct?.archive_id}`);
|
||||
}
|
||||
let results = await db_archives.archive
|
||||
.get($idaa_slct?.archive_id ?? ''); // null or undefined does not reset things like '' does
|
||||
|
||||
@@ -85,10 +88,19 @@ let lq__archive_content_obj_li = $derived(liveQuery(async () => {
|
||||
}));
|
||||
|
||||
let lq__archive_content_obj = $derived(liveQuery(async () => {
|
||||
let results = await db_archives.content
|
||||
.get($idaa_slct.archive_content_id ?? ''); // null or undefined does not reset things like '' does
|
||||
if (log_lvl) {
|
||||
console.log(`lq__archive_content_obj: archive_content_id = ${$idaa_slct?.archive_content_id}`);
|
||||
}
|
||||
if ($idaa_slct.archive_content_id) {
|
||||
let results = await db_archives.content
|
||||
.get($idaa_slct.archive_content_id); // null or undefined does not reset things like '' does
|
||||
|
||||
return results;
|
||||
return results;
|
||||
}
|
||||
// const results = await db_archives.content
|
||||
// .get($idaa_slct.archive_content_id); // null or undefined does not reset things like '' does
|
||||
|
||||
// return results;
|
||||
}));
|
||||
|
||||
|
||||
@@ -266,8 +278,8 @@ if (browser) {
|
||||
|
||||
<!-- Modal: Archive Content edit ID -->
|
||||
<Modal
|
||||
title="{$lq__archive_content_obj?.name ?? 'New Archive Content'} - {$lq__archive_content_obj?.id ?? 'Not Saved Yet'}"
|
||||
bind:open={$idaa_sess.archives.show__modal_edit__archive_content_id}
|
||||
title="{$lq__archive_content_obj?.name ?? 'New Archive Content'} - {$lq__archive_content_obj?.id ?? 'Not Saved Yet'}"
|
||||
autoclose={false}
|
||||
placement="top-center"
|
||||
size="xl"
|
||||
@@ -332,10 +344,22 @@ if (browser) {
|
||||
|
||||
|
||||
<!-- Modal: Archive Content ID media player -->
|
||||
<!-- {#if $lq__archive_content_obj?.name} -->
|
||||
{#if $idaa_slct.archive_content_id && $idaa_sess.archives.show__modal_view__archive_content_id}
|
||||
<Modal_media_player
|
||||
lq__archive_content_obj={lq__archive_content_obj}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
{#if 1==2}
|
||||
<Modal
|
||||
title="{$lq__archive_content_obj?.name} - {$lq__archive_content_obj?.archive_content_id}"
|
||||
bind:open={$idaa_sess.archives.show__modal_view__archive_content_id}
|
||||
autoclose={false}
|
||||
title="{$lq__archive_content_obj?.name} - {$lq__archive_content_obj?.archive_content_id}"
|
||||
autoclose={true}
|
||||
onclose={() => {
|
||||
// We want to cancel the inline edit if the modal is closed
|
||||
// $idaa_sess.archives.show__inline_edit__archive_content_id = false;
|
||||
}}
|
||||
outsideclose={true}
|
||||
placement="top-center"
|
||||
size="xl"
|
||||
@@ -349,7 +373,7 @@ if (browser) {
|
||||
<span class="text-sm text-gray-500">
|
||||
Viewing:
|
||||
</span>
|
||||
{$lq__archive_content_obj?.name} - {$lq__archive_content_obj?.archive_content_id}</h3>
|
||||
{$idaa_slct.archive_content_obj?.name} - {$lq__archive_content_obj?.archive_content_id}</h3>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -359,4 +383,7 @@ if (browser) {
|
||||
lq__archive_content_obj={lq__archive_content_obj}
|
||||
/>
|
||||
|
||||
</Modal>
|
||||
{$lq__archive_content_obj?.archive_content_id}
|
||||
|
||||
</Modal>
|
||||
{/if}
|
||||
Reference in New Issue
Block a user