Fix calls to new DestroyDraftTask

This commit is contained in:
Ben Gotow 2017-07-09 13:16:01 -07:00
parent 94ef9813b6
commit 432baa6a3a

View file

@ -126,7 +126,10 @@ class DraftStore extends NylasStore {
_.each(this._draftSessions, (session) => {
const draft = session.draft()
if (draft && draft.pristine) {
Actions.queueTask(new DestroyDraftTask(draft.accountId, draft.headerMessageId));
Actions.queueTask(new DestroyDraftTask({
accountId: draft.accountId,
headerMessageId: draft.headerMessageId,
}));
} else {
promises.push(session.changes.commit());
}
@ -353,7 +356,7 @@ class DraftStore extends NylasStore {
})
// Queue the task to destroy the draft
Actions.queueTask(new DestroyDraftTask(accountId, headerMessageId));
Actions.queueTask(new DestroyDraftTask({accountId, headerMessageId}));
if (NylasEnv.isComposerWindow()) {
NylasEnv.close();