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 21c2b505..ee4b28a4 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 @@ -131,7 +131,6 @@ async function handle_submit_form(event: any) { post_comment_do['group'] = post_comment_form.group ?? null; post_comment_do['enable'] = post_comment_form.enable ?? true; - log_lvl = 1; if (log_lvl) { console.log('Final Payload (post_comment_do):', post_comment_do); } diff --git a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte index 4717fc5b..32b0c695 100644 --- a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte +++ b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_obj_id_edit.svelte @@ -131,9 +131,33 @@ async function handle_submit_form(event: any) { post_do['anonymous'] = post_di.anonymous; - post_do['external_person_id'] = post_di.external_person_id; - post_do['full_name'] = post_di.full_name; - post_do['email'] = post_di.email; + // Robust scavenging: the form input falls back to $idaa_loc.novi_uuid at render + // time, but if the store was null during that render (race condition on mount) the + // input would have captured an empty string. Re-check the store and then + // localStorage so legacy posts without an external_person_id never overwrite with ''. + let identity_person_id: string | null = post_di.external_person_id || null; + let identity_full_name: string | null = post_di.full_name || null; + let identity_email: string | null = post_di.email || null; + if (!identity_person_id) { + identity_person_id = $idaa_loc.novi_uuid ?? null; + identity_full_name = identity_full_name || $idaa_loc.novi_full_name || null; + identity_email = identity_email || $idaa_loc.novi_email || null; + } + if (!identity_person_id && typeof localStorage !== 'undefined') { + try { + const ls_val = localStorage.getItem('ae_idaa_loc'); + if (ls_val) { + const ls_json = JSON.parse(ls_val); + identity_person_id = ls_json.novi_uuid ?? null; + identity_full_name = identity_full_name || ls_json.novi_full_name || null; + identity_email = identity_email || ls_json.novi_email || null; + } + } catch (e) { /* ignore */ } + } + + post_do['external_person_id'] = identity_person_id; + post_do['full_name'] = identity_full_name; + post_do['email'] = identity_email; post_do['notify'] = post_di.notify; post_do['hide'] = post_di.hide; diff --git a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_options.svelte b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_options.svelte index 50036005..0087e892 100644 --- a/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_options.svelte +++ b/src/routes/idaa/(idaa)/bb/ae_idaa_comp__post_options.svelte @@ -248,8 +248,8 @@ let creating = $state(false); // true while create API call is in-flight ); goto(`/idaa/bb/${final_id}`); } else { + // .catch() already alerted the user — just reset the flag. creating = false; - alert('Failed to create new post.'); } }); }}