Reset BB dirty state after save

This commit is contained in:
Scott Idem
2026-05-01 18:53:28 -04:00
parent 8a23e7b7b3
commit 5cbdec3b5c

View File

@@ -187,6 +187,8 @@ async function handle_submit_form(event: SubmitEvent) {
send_staff_notification_email(post_obj_create_result);
}
mark_post_form_saved(post_obj_create_result);
if (post_obj_create_result.post_id) {
goto(`/idaa/bb/${post_obj_create_result.post_id}`);
}
@@ -229,6 +231,8 @@ async function handle_submit_form(event: SubmitEvent) {
send_staff_notification_email(post_obj_update_result);
}
mark_post_form_saved(post_obj_update_result);
return post_obj_update_result;
})
.catch(function (error: unknown) {
@@ -350,6 +354,17 @@ function send_staff_notification_email(post_do: key_val) {
});
}
function mark_post_form_saved(saved_post_obj: BbPostObjectLike) {
orig_post_obj = {
...saved_post_obj,
content: content_new_html,
notes: notes_new_html
};
orig_post_form = JSON.parse(JSON.stringify(post_form));
force_saveable_new_post = false;
obj_changed = false;
}
$effect(() => {
// Initialization Layer
const current_post_id =