mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-07 16:48:02 +08:00
76036e82bd
Summary: - In Gmail all threads /must/ belong to either All Mail, Trash and Spam, and they are mutually exclusive, so we need to make sure that any add/remove label operation still guarantees that constraint - Update ChangeLabelsTask to modify the set of labels to add and remove based on this rule - Update tasksFor archiving, moving to trash and moving to spam so they don't affect any other labels in the thread, as gmail does. - Removing from view /will/ remove any current labels, but will also move between all mail and trash as needed - Remove Inbox, Trash and Spam from the CategoryPicker, as Gmail does Test Plan: - Unit tests Reviewers: drew, evan, bengotow Reviewed By: drew, evan, bengotow Differential Revision: https://phab.nylas.com/D2715
28 lines
759 B
CoffeeScript
28 lines
759 B
CoffeeScript
{React,
|
|
Actions,
|
|
Thread,
|
|
DatabaseStore,
|
|
TaskFactory,
|
|
ComposerExtension,
|
|
FocusedPerspectiveStore} = require 'nylas-exports'
|
|
|
|
{RetinaImg} = require 'nylas-component-kit'
|
|
|
|
class SendAndArchiveExtension extends ComposerExtension
|
|
@sendActionConfig: ({draft}) ->
|
|
if draft.threadId
|
|
return {
|
|
title: "Send and Archive"
|
|
iconUrl: "nylas://send-and-archive/images/composer-archive@2x.png"
|
|
onSend: @_sendAndArchive
|
|
}
|
|
else return null
|
|
|
|
@_sendAndArchive: ({draft}) ->
|
|
Actions.sendDraft(draft.clientId)
|
|
DatabaseStore.modelify(Thread, [draft.threadId]).then (threads) =>
|
|
tasks = TaskFactory.tasksForArchiving
|
|
threads: threads
|
|
Actions.queueTasks(tasks)
|
|
|
|
module.exports = SendAndArchiveExtension
|