Skip to content

Commit

Permalink
compose: Delete drafts with attachments.
Browse files Browse the repository at this point in the history
Draft messages containing attachments, polls, or other items that cannot be locally 
echoed would not be deleted after sending the message. 

The explanation is simple: We only cleared the draft associated with a message in the 
`reify_message_id` local echo code path.

Fixes zulip#24063.
  • Loading branch information
SahilSingh177 committed Jan 25, 2023
1 parent dedea23 commit d05f672
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions static/js/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ export function clear_compose_box() {

export function send_message_success(local_id, message_id, locally_echoed) {
if (!locally_echoed) {
if ($("#compose-textarea").data("draft-id")) {
drafts.draft_model.deleteDraft($("#compose-textarea").data("draft-id"));
}
clear_compose_box();
}

Expand Down

0 comments on commit d05f672

Please sign in to comment.