mirror of
https://github.com/zulip/zulip.git
synced 2025-11-17 20:41:46 +00:00
drafts: Don't update draft count when successfully sending messages.
Fixes #21757. Previously the draft count would briefly increase between the action of sending a message and the success of sending that message. Now the draft count will only increase if the message fails to send.
This commit is contained in:
@@ -11,6 +11,7 @@ import * as compose_fade from "./compose_fade";
|
||||
import * as compose_state from "./compose_state";
|
||||
import * as compose_ui from "./compose_ui";
|
||||
import * as compose_validate from "./compose_validate";
|
||||
import * as drafts from "./drafts";
|
||||
import * as echo from "./echo";
|
||||
import * as flatpickr from "./flatpickr";
|
||||
import {$t, $t_html} from "./i18n";
|
||||
@@ -256,6 +257,10 @@ export function send_message(request = create_message_object()) {
|
||||
}
|
||||
|
||||
echo.message_send_error(message.id, response);
|
||||
|
||||
// We might not have updated the draft count because we assumed the
|
||||
// message would send. Ensure that the displayed count is correct.
|
||||
drafts.sync_count();
|
||||
}
|
||||
|
||||
transmit.send_message(request, success, error);
|
||||
|
||||
Reference in New Issue
Block a user