mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-12-28 11:24:11 +08:00
Fix: sending draft with metadata when it has not yet been saved
This commit is contained in:
parent
335373c69f
commit
24fac237cf
1 changed files with 6 additions and 1 deletions
|
@ -378,10 +378,15 @@ class DraftStore extends MailspringStore {
|
|||
// completely saved and the user won't see old content briefly.
|
||||
const session = await this.sessionForClientId(headerMessageId);
|
||||
await session.ensureCorrectAccount();
|
||||
let draft = session.draft();
|
||||
await session.changes.commit();
|
||||
await session.teardown();
|
||||
|
||||
// ensureCorrectAccount / commit may assign this draft a new ID. To move forward
|
||||
// we need to have the final object with it's final ID.
|
||||
let draft = await DatabaseStore.findBy(Message, { headerMessageId, draft: true }).include(
|
||||
Message.attributes.body
|
||||
);
|
||||
|
||||
draft = await DraftHelpers.applyExtensionTransforms(draft);
|
||||
draft = await DraftHelpers.pruneRemovedInlineFiles(draft);
|
||||
if (draft.replyToHeaderMessageId && DraftHelpers.shouldAppendQuotedText(draft)) {
|
||||
|
|
Loading…
Reference in a new issue