Mailspring/packages/client-app/internal_packages/send-and-archive/lib/send-and-archive-extension.es6
Ben Gotow ef9a1b1164 Revert "[client-app] Measure and report archiving times"
This reverts commit a8fbcb0c93.

# Conflicts:
#	packages/client-app/internal_packages/thread-list/lib/thread-list-quick-actions.cjsx
#	packages/client-app/internal_packages/thread-list/lib/thread-list.cjsx
#	packages/client-app/src/flux/actions.es6
#	packages/client-app/src/flux/stores/thread-list-actions-store.es6
#	packages/client-app/src/global/nylas-exports.es6
#	packages/isomorphic-core/src/metrics-reporter.es6
2017-06-23 16:09:29 -07:00

32 lines
739 B
JavaScript

import {
Actions,
Thread,
DatabaseStore,
TaskFactory,
SendDraftTask,
} from 'nylas-exports'
export const name = 'SendAndArchiveExtension'
export function sendActions() {
return [{
title: 'Send and Archive',
iconUrl: 'nylas://send-and-archive/images/composer-archive@2x.png',
isAvailableForDraft({draft}) {
return draft.threadId != null
},
performSendAction({draft}) {
Actions.queueTask(new SendDraftTask(draft.id))
return DatabaseStore.modelify(Thread, [draft.threadId])
.then((threads) => {
const tasks = TaskFactory.tasksForArchiving({
source: "Send and Archive",
threads: threads,
})
Actions.queueTasks(tasks)
})
},
}]
}