Bug fixes
This commit is contained in:
@@ -47,7 +47,7 @@ import Help_tech from '$lib/e_app_help_tech.svelte';
|
|||||||
// if (!archive_content_id) {
|
// if (!archive_content_id) {
|
||||||
// $idaa_slct.archive_content_id = null;
|
// $idaa_slct.archive_content_id = null;
|
||||||
// } else {
|
// } else {
|
||||||
// console.log(`ae Posts - [archive_content_id] +page.ts: archive_content_id = `, archive_content_id);
|
// console.log(`ae Archives - [archive_content_id] +page.ts: archive_content_id = `, archive_content_id);
|
||||||
// $idaa_slct.archive_content_id = archive_content_id;
|
// $idaa_slct.archive_content_id = archive_content_id;
|
||||||
// $idaa_trig.archive_content_id = archive_content_id;
|
// $idaa_trig.archive_content_id = archive_content_id;
|
||||||
// }
|
// }
|
||||||
@@ -109,6 +109,18 @@ let lq__archive_content_obj_li = $derived(liveQuery(async () => {
|
|||||||
// .reverse()
|
// .reverse()
|
||||||
.sortBy('tmp_sort_1');
|
.sortBy('tmp_sort_1');
|
||||||
|
|
||||||
|
|
||||||
|
if ($idaa_slct.archive_content_obj_li && JSON.stringify($idaa_slct.archive_content_obj_li) !== JSON.stringify(results)) {
|
||||||
|
$idaa_slct.archive_content_obj_li = [...results];
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`$idaa_slct.archive_content_obj_li = `, $idaa_slct.archive_content_obj_li);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`Archive content object list has not changed for archive_id: ${$idaa_slct.archive_id}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,16 +130,26 @@ let lq__archive_content_obj = $derived(liveQuery(async () => {
|
|||||||
if (log_lvl) {
|
if (log_lvl) {
|
||||||
console.log(`lq__archive_content_obj: archive_content_id = ${$idaa_slct?.archive_content_id}`);
|
console.log(`lq__archive_content_obj: archive_content_id = ${$idaa_slct?.archive_content_id}`);
|
||||||
}
|
}
|
||||||
if ($idaa_slct.archive_content_id) {
|
// if ($idaa_slct.archive_content_id) {
|
||||||
let results = await db_archives.content
|
let results = await db_archives.content
|
||||||
.get($idaa_slct.archive_content_id); // null or undefined does not reset things like '' does
|
.get($idaa_slct.archive_content_id ?? ''); // null or undefined does not reset things like '' does
|
||||||
|
|
||||||
|
// Check if results are different than the current $idaa_slct.archive_content_obj
|
||||||
|
if ($idaa_slct.archive_content_obj && results) {
|
||||||
|
if (JSON.stringify($idaa_slct.archive_content_obj) !== JSON.stringify(results)) {
|
||||||
|
$idaa_slct.archive_content_obj = { ...results };
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`$idaa_slct.archive_content_obj = `, $idaa_slct.archive_content_obj);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (log_lvl) {
|
||||||
|
console.log(`Archive content object has not changed for archive_content_id: ${$idaa_slct.archive_content_id}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
@@ -386,9 +408,10 @@ onDestroy(() => {
|
|||||||
|
|
||||||
|
|
||||||
<!-- Modal: Archive Content edit ID -->
|
<!-- Modal: Archive Content edit ID -->
|
||||||
|
<!-- title="{$lq__archive_content_obj?.name ?? 'New Archive Content'} - {$lq__archive_content_obj?.id ?? 'Not Saved Yet'}" -->
|
||||||
|
<!-- {#if $idaa_sess.archives.show__modal_edit__archive_content_id} -->
|
||||||
<Modal
|
<Modal
|
||||||
bind:open={$idaa_sess.archives.show__modal_edit__archive_content_id}
|
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}
|
autoclose={false}
|
||||||
placement="top-center"
|
placement="top-center"
|
||||||
size="xl"
|
size="xl"
|
||||||
@@ -403,25 +426,28 @@ onDestroy(() => {
|
|||||||
<!-- <div class="ae_options"> -->
|
<!-- <div class="ae_options"> -->
|
||||||
<button
|
<button
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
// const url = new URL(location);
|
// const url = new URL(location);
|
||||||
// url.searchParams.set('event_id', $lq__archive_content_obj?.event_id_random);
|
// url.searchParams.set('event_id', $lq__archive_content_obj?.event_id_random);
|
||||||
// history.pushState({}, '', url);
|
// history.pushState({}, '', url);
|
||||||
|
|
||||||
$idaa_sess.archives.show__modal_view__archive_content_id = $idaa_slct.archive_content_id;
|
// $idaa_sess.archives.show__modal_view__archive_content_id = $idaa_slct.archive_content_id;
|
||||||
$idaa_sess.archives.show__modal_edit__archive_content_id = false;
|
$idaa_slct.archive_content_id = null;
|
||||||
}}
|
$idaa_slct.archive_content_obj = {};
|
||||||
|
|
||||||
|
$idaa_sess.archives.show__modal_edit__archive_content_id = false;
|
||||||
|
}}
|
||||||
class="novi_btn btn btn-sm preset-tonal-warning border border-warning-500 hover:preset-filled-warning-500 transition"
|
class="novi_btn btn btn-sm preset-tonal-warning border border-warning-500 hover:preset-filled-warning-500 transition"
|
||||||
title={`View meeting: ${$lq__archive_content_obj?.name}`}
|
title={`View meeting: ${$lq__archive_content_obj?.name}`}
|
||||||
>
|
>
|
||||||
<span class="fas fa-eye m-1"></span> View
|
<span class="fas fa-eye m-1"></span> Cancel
|
||||||
</button>
|
</button>
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<span class="text-sm text-gray-500">
|
<span class="text-sm text-gray-500">
|
||||||
Edit Archive Content:
|
Edit Content:
|
||||||
</span>
|
</span>
|
||||||
{$lq__archive_content_obj?.name ?? 'New Archive Content'}
|
{$idaa_slct.archive_content_obj?.name ?? 'New Archive Content'}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -447,38 +473,9 @@ onDestroy(() => {
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
</Modal>
|
</Modal>
|
||||||
|
<!-- {/if} -->
|
||||||
|
|
||||||
|
|
||||||
<!-- Modal: Archive Content ID media player -->
|
|
||||||
<!-- {#if $idaa_slct.archive_content_id && $idaa_sess.archives.show__modal_view__archive_content_id} -->
|
|
||||||
|
|
||||||
<!-- <Modal
|
|
||||||
bind:open={$idaa_sess.archives.show__modal_view__archive_content_id}
|
|
||||||
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"
|
|
||||||
class=""
|
|
||||||
>
|
|
||||||
|
|
||||||
{#snippet header()}
|
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between w-full">
|
|
||||||
<h3 class="text-lg font-semibold">
|
|
||||||
<span class="text-sm text-gray-500">
|
|
||||||
Viewing:
|
|
||||||
</span>
|
|
||||||
{$idaa_slct.archive_content_obj?.name} - {$lq__archive_content_obj?.archive_content_id}</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
{/snippet} -->
|
|
||||||
|
|
||||||
<!-- Showing and hiding a modal like this seems to cause an issue with where it is rendered on the page. The <Modal> should be moved back here and the actual "player" left mostly separate. 2025-07-10 -->
|
<!-- Showing and hiding a modal like this seems to cause an issue with where it is rendered on the page. The <Modal> should be moved back here and the actual "player" left mostly separate. 2025-07-10 -->
|
||||||
<!-- {#if $idaa_slct.archive_content_id} -->
|
<!-- {#if $idaa_slct.archive_content_id} -->
|
||||||
<Modal_media_player
|
<Modal_media_player
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
interface Props {
|
||||||
|
lq__archive_content_obj_li: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
let { lq__archive_content_obj_li }: Props = $props();
|
||||||
|
|
||||||
// *** Import Svelte specific
|
// *** Import Svelte specific
|
||||||
import { goto, invalidate, pushState, replaceState } from '$app/navigation';
|
import { goto, invalidate, pushState, replaceState } from '$app/navigation';
|
||||||
|
|
||||||
@@ -9,12 +15,6 @@ import { api } from '$lib/api';
|
|||||||
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||||
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
|
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
|
||||||
|
|
||||||
interface Props {
|
|
||||||
lq__archive_content_obj_li: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
let { lq__archive_content_obj_li }: Props = $props();
|
|
||||||
|
|
||||||
let ae_promises: key_val = $state({});
|
let ae_promises: key_val = $state({});
|
||||||
// let ae_tmp: key_val = {};
|
// let ae_tmp: key_val = {};
|
||||||
// let ae_triggers: key_val = {};
|
// let ae_triggers: key_val = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user