mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-21 07:27:51 +08:00
Teardown the draft session on send to avoid final syncback task
This commit is contained in:
parent
9fcca0ea0b
commit
6598a29fbb
1 changed files with 4 additions and 1 deletions
|
@ -361,11 +361,14 @@ class DraftStore extends MailspringStore {
|
||||||
const session = await this.sessionForClientId(headerMessageId);
|
const session = await this.sessionForClientId(headerMessageId);
|
||||||
const draft = await DraftHelpers.draftPreparedForSyncback(session);
|
const draft = await DraftHelpers.draftPreparedForSyncback(session);
|
||||||
|
|
||||||
|
// Prevent any further changes to the session or draft
|
||||||
|
session.teardown();
|
||||||
|
|
||||||
// Directly update the message body cache so the user immediately sees
|
// Directly update the message body cache so the user immediately sees
|
||||||
// the new message text (and never old draft text or blank text) sending.
|
// the new message text (and never old draft text or blank text) sending.
|
||||||
await MessageBodyProcessor.updateCacheForMessage(draft);
|
await MessageBodyProcessor.updateCacheForMessage(draft);
|
||||||
|
|
||||||
// At this point the message UI enters the sending state.
|
// At this point the message UI enters the sending state and the composer is unmounted.
|
||||||
this.trigger({ headerMessageId });
|
this.trigger({ headerMessageId });
|
||||||
|
|
||||||
// Now do the actual sending!
|
// Now do the actual sending!
|
||||||
|
|
Loading…
Reference in a new issue