diff --git a/src/routes/idaa/(idaa)/bb/[post_id]/+page.ts b/src/routes/idaa/(idaa)/bb/[post_id]/+page.ts index 7f6ba1bc..ae388c5b 100644 --- a/src/routes/idaa/(idaa)/bb/[post_id]/+page.ts +++ b/src/routes/idaa/(idaa)/bb/[post_id]/+page.ts @@ -2,7 +2,6 @@ import type { PageLoad } from './$types'; console.log(`ae_idaa_bulletin_board [post_id] +page.ts start`); -import { error } from '@sveltejs/kit'; import { browser } from '$app/environment'; import { posts_func } from '$lib/ae_posts/ae_posts_functions'; @@ -24,8 +23,11 @@ export const load = (async ({ params, parent }) => { if (log_lvl) { console.log(`ae_idaa_posts posts [post_id] +page.ts: post_id = `, post_id); } - // Load post object - const load_post_obj = await posts_func + // NOTE: Fire in background — do NOT await. Newly created posts are already in Dexie + // (saved by create_ae_obj__post), so the liveQuery renders immediately. For direct + // links or refreshes, the post loads from the API and Dexie updates reactively. + // Awaiting here blocked the SvelteKit navigation, causing a visible "refresh" delay. + posts_func .load_ae_obj_id__post({ api_cfg: ae_acct.api, post_id: post_id, @@ -34,18 +36,9 @@ export const load = (async ({ params, parent }) => { }) .then((results) => { if (!results) { - error(404, { - message: 'IDAA BB - Post not found' - }); - } else { - // ae_acct.slct.post_obj = results; + console.warn(`ae IDAA BB [post_id] +page.ts: Post ${post_id} not found via API or Cache.`); } }); - - if (log_lvl) { - console.log(`load_post_obj = `, load_post_obj); - } - ae_acct.slct.post_obj = load_post_obj; } // WARNING: Precaution against shared data between sites. diff --git a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_comment_obj_id_edit.svelte b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_comment_obj_id_edit.svelte index d5ac551d..784468dc 100644 --- a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_comment_obj_id_edit.svelte +++ b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_comment_obj_id_edit.svelte @@ -105,13 +105,6 @@ post_comment_do['group'] = post_comment_form.group ?? null; post_comment_do['enable'] = post_comment_form.enable ?? true; - if (!$idaa_slct.post_comment_id) { - // NEW COMMENT: Ensure post_id is included - const parent_post_id = $idaa_slct.post_id; - post_comment_do['post_id'] = parent_post_id; - // post_comment_do['post_id'] = parent_post_id; - } - log_lvl = 1; if (log_lvl) { console.log('Final Payload (post_comment_do):', post_comment_do); @@ -819,7 +812,7 @@ Copy and paste link: ${ type="submit" disabled={disable_submit_btn} onclick={() => { - if (!confirm('Are you sure you want to create this post?')) { + if (!confirm('Are you sure you want to add this comment?')) { return false; } // handle_save_post_comment_obj({post_id: $idaa_slct.post_id, method: 'create'}); diff --git a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_view.svelte b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_view.svelte index b8566d48..f23c7c36 100644 --- a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_view.svelte +++ b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_view.svelte @@ -161,13 +161,8 @@ {#if ($ae_loc.trusted_access && $ae_loc.edit_mode) || $idaa_loc.novi_uuid} {/if}