diff --git a/frontend_tests/node_tests/compose.js b/frontend_tests/node_tests/compose.js index ff7ad3dc42..638341dcf0 100644 --- a/frontend_tests/node_tests/compose.js +++ b/frontend_tests/node_tests/compose.js @@ -352,7 +352,7 @@ test_ui("markdown_shortcuts", (override) => { }); test_ui("send_message_success", (override) => { - override(drafts, "delete_draft_after_send", () => {}); + override(drafts, "delete_active_draft", () => {}); $("#compose-textarea").val("foobarfoobar"); $("#compose-textarea").trigger("blur"); @@ -381,7 +381,7 @@ test_ui("send_message_success", (override) => { test_ui("send_message", (override) => { MockDate.set(new Date(fake_now * 1000)); - override(drafts, "delete_draft_after_send", () => {}); + override(drafts, "delete_active_draft", () => {}); override(sent_messages, "start_tracking_message", () => {}); // This is the common setup stuff for all of the four tests. diff --git a/static/js/compose.js b/static/js/compose.js index 4168e46ddb..019f915747 100644 --- a/static/js/compose.js +++ b/static/js/compose.js @@ -289,7 +289,7 @@ function compose_not_subscribed_error(error_html, bad_input) { export function clear_compose_box() { $("#compose-textarea").val("").trigger("focus"); - drafts.delete_draft_after_send(); + drafts.delete_active_draft(); compose_ui.autosize_textarea($("#compose-textarea")); $("#compose-send-status").hide(0); $("#compose-send-button").prop("disabled", false); diff --git a/static/js/drafts.js b/static/js/drafts.js index 9276f6e08f..2772b06118 100644 --- a/static/js/drafts.js +++ b/static/js/drafts.js @@ -180,7 +180,7 @@ export function update_draft() { draft_notify(); } -export function delete_draft_after_send() { +export function delete_active_draft() { const draft_id = $("#compose-textarea").data("draft-id"); if (draft_id) { draft_model.deleteDraft(draft_id);