fix(idaa): finalize null-safety for BB comment editor
- Added optional chaining to all post_comment_obj property accesses. - Resolved TypeError when clicking 'New Comment' button. - Hardened UI stability for asynchronous data loading.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user