fix(send): Don't queue an upload task if there are no files

This commit is contained in:
Ben Gotow 2016-03-24 19:30:47 -07:00
parent 59080a6654
commit ab587d48ff

View file

@ -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)