Reset BB dirty state after save
This commit is contained in:
@@ -187,6 +187,8 @@ async function handle_submit_form(event: SubmitEvent) {
|
|||||||
send_staff_notification_email(post_obj_create_result);
|
send_staff_notification_email(post_obj_create_result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mark_post_form_saved(post_obj_create_result);
|
||||||
|
|
||||||
if (post_obj_create_result.post_id) {
|
if (post_obj_create_result.post_id) {
|
||||||
goto(`/idaa/bb/${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);
|
send_staff_notification_email(post_obj_update_result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mark_post_form_saved(post_obj_update_result);
|
||||||
|
|
||||||
return post_obj_update_result;
|
return post_obj_update_result;
|
||||||
})
|
})
|
||||||
.catch(function (error: unknown) {
|
.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(() => {
|
$effect(() => {
|
||||||
// Initialization Layer
|
// Initialization Layer
|
||||||
const current_post_id =
|
const current_post_id =
|
||||||
|
|||||||
Reference in New Issue
Block a user