mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-07 05:25:30 +08:00
Wait for draft changes to be saved before clearing change set
This commit is contained in:
parent
941cb45cb6
commit
f15ba78cc5
3 changed files with 5 additions and 4 deletions
app
internal_packages/composer/lib
src/flux/stores
|
@ -594,8 +594,7 @@ export default class ComposerView extends React.Component {
|
|||
};
|
||||
|
||||
_onDestroyDraft = () => {
|
||||
const { draft } = this.props;
|
||||
Actions.destroyDraft(draft);
|
||||
Actions.destroyDraft(this.props.draft);
|
||||
};
|
||||
|
||||
_onSelectAttachment = () => {
|
||||
|
|
|
@ -390,7 +390,9 @@ export default class DraftEditingSession extends MailspringStore {
|
|||
// by creating a new draft
|
||||
const baseDraft = draft || inMemoryDraft;
|
||||
const updatedDraft = this.changes.applyToModel(baseDraft);
|
||||
Actions.queueTask(new SyncbackDraftTask({ draft: updatedDraft }));
|
||||
const task = new SyncbackDraftTask({ draft: updatedDraft });
|
||||
Actions.queueTask(task);
|
||||
await TaskQueue.waitForPerformLocal(task);
|
||||
}
|
||||
|
||||
// Undo / Redo
|
||||
|
|
|
@ -110,8 +110,8 @@ class DraftStore extends MailspringStore {
|
|||
if (draft && draft.pristine) {
|
||||
Actions.queueTask(
|
||||
new DestroyDraftTask({
|
||||
messageIds: [draft.id],
|
||||
accountId: draft.accountId,
|
||||
messageIds: [draft.headerMessageId],
|
||||
})
|
||||
);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue