From ab587d48ff4de188cc75e3455c0e6c3d241253db Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Thu, 24 Mar 2016 19:30:47 -0700 Subject: [PATCH] fix(send): Don't queue an upload task if there are no files --- src/flux/stores/draft-store.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/flux/stores/draft-store.coffee b/src/flux/stores/draft-store.coffee index 694fc7639..81ea1838b 100644 --- a/src/flux/stores/draft-store.coffee +++ b/src/flux/stores/draft-store.coffee @@ -314,7 +314,8 @@ class DraftStore _onEnsureDraftSynced: (draftClientId) => @sessionForClientId(draftClientId).then (session) => @_prepareForSyncback(session).then => - Actions.queueTask(new SyncbackDraftFilesTask(draftClientId)) + if session.draft().files.length or session.draft().uploads.length + Actions.queueTask(new SyncbackDraftFilesTask(draftClientId)) Actions.queueTask(new SyncbackDraftTask(draftClientId)) _onSendDraft: (draftClientId) => @@ -324,7 +325,8 @@ class DraftStore @_prepareForSyncback(session).then => if NylasEnv.config.get("core.sending.sounds") SoundRegistry.playSound('hit-send') - Actions.queueTask(new SyncbackDraftFilesTask(draftClientId)) + if session.draft().files.length or session.draft().uploads.length + Actions.queueTask(new SyncbackDraftFilesTask(draftClientId)) Actions.queueTask(new SendDraftTask(draftClientId)) @_doneWithSession(session)