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 a2ccedbd..0df35a21 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 @@ -38,7 +38,22 @@ let prom_api__post_comment_obj: any = $state(); - let content_new_html = $state($idaa_slct.post_comment_obj?.content ?? ''); + // SVELTE 5 STABILITY: Use local state for form bindings to prevent + // crashes when the global store object is briefly null. + let post_comment_form = $state({ + content: $idaa_slct.post_comment_obj?.content ?? '', + anonymous: $idaa_slct.post_comment_obj?.anonymous ?? false, + external_person_id: $idaa_slct.post_comment_obj?.external_person_id ?? '', + full_name: $idaa_slct.post_comment_obj?.full_name ?? '', + email: $idaa_slct.post_comment_obj?.email ?? '', + enable: $idaa_slct.post_comment_obj?.enable ?? true, + hide: $idaa_slct.post_comment_obj?.hide ?? false, + priority: $idaa_slct.post_comment_obj?.priority ?? false, + sort: $idaa_slct.post_comment_obj?.sort ?? 0, + group: $idaa_slct.post_comment_obj?.group ?? '' + }); + + let content_new_html = $state(post_comment_form.content); let content_changed = $state(false); // let notes_new_html = $state(''); // let notes_changed = $state(false);