From 96eea9590319bfdef3363c2df13a4279d582f1e6 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Tue, 8 Aug 2017 10:01:58 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20missing=20=E2=80=9Cnew=E2=80=9D=20keyword?= =?UTF-8?q?=20-=20weird=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thread-list/lib/thread-list.cjsx | 2 +- .../lib/search-mailbox-perspective.es6 | 4 ++-- .../thread-snooze/lib/snooze-utils.es6 | 13 ++++++------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/client-app/internal_packages/thread-list/lib/thread-list.cjsx b/packages/client-app/internal_packages/thread-list/lib/thread-list.cjsx index 097725985..559171867 100644 --- a/packages/client-app/internal_packages/thread-list/lib/thread-list.cjsx +++ b/packages/client-app/internal_packages/thread-list/lib/thread-list.cjsx @@ -290,7 +290,7 @@ class ThreadList extends React.Component return unless NylasEnv.config.get('core.workspace.showImportant') Actions.queueTasks(TaskFactory.tasksForThreadsByAccountId(threads, (accountThreads, accountId) => - return ChangeLabelsTask({ + return new ChangeLabelsTask({ threads: accountThreads, source: "Keyboard Shortcut" labelsToAdd: if important then [CategoryStore.getCategoryByRole(accountId, 'important')] else [] diff --git a/packages/client-app/internal_packages/thread-search/lib/search-mailbox-perspective.es6 b/packages/client-app/internal_packages/thread-search/lib/search-mailbox-perspective.es6 index 077a230b4..06926ebcf 100644 --- a/packages/client-app/internal_packages/thread-search/lib/search-mailbox-perspective.es6 +++ b/packages/client-app/internal_packages/thread-search/lib/search-mailbox-perspective.es6 @@ -59,7 +59,7 @@ class SearchMailboxPerspective extends MailboxPerspective { const dest = account.preferredRemovalDestination(); if (dest instanceof Folder) { - return ChangeFolderTask({ + return new ChangeFolderTask({ threads: accountThreads, source: "Dragged out of list", folder: dest, @@ -67,7 +67,7 @@ class SearchMailboxPerspective extends MailboxPerspective { } if (dest.role === 'all') { // if you're searching and archive something, it really just removes the inbox label - return ChangeLabelsTask({ + return new ChangeLabelsTask({ threads: accountThreads, source: "Dragged out of list", labelsToRemove: [CategoryStore.getInboxCategory(accountId)], diff --git a/packages/client-app/internal_packages/thread-snooze/lib/snooze-utils.es6 b/packages/client-app/internal_packages/thread-snooze/lib/snooze-utils.es6 index 9f5ddfdbc..f4486f0ca 100644 --- a/packages/client-app/internal_packages/thread-snooze/lib/snooze-utils.es6 +++ b/packages/client-app/internal_packages/thread-snooze/lib/snooze-utils.es6 @@ -1,5 +1,4 @@ import moment from 'moment'; -import _ from 'underscore'; import { Actions, Thread, @@ -79,7 +78,7 @@ const SnoozeUtils = { const snoozeCat = getSnoozeCategory(accountId); const inboxCat = getInboxCategory(accountId); if (snoozeCat instanceof Label) { - return ChangeLabelsTask({ + return new ChangeLabelsTask({ source: "Snooze Move", threads: accountThreads, taskDescription: description, @@ -87,7 +86,7 @@ const SnoozeUtils = { labelsToRemove: snooze ? [inboxCat] : [snoozeCat], }); } - return ChangeFolderTask({ + return new ChangeFolderTask({ source: "Snooze Move", threads: accountThreads, taskDescription: description, @@ -108,8 +107,8 @@ const SnoozeUtils = { moveThreadsToSnooze(threads, snoozeCategoriesByAccountPromise, snoozeDate) { return snoozeCategoriesByAccountPromise .then((snoozeCategoriesByAccountId) => { - const getSnoozeCategory = (accId) => [snoozeCategoriesByAccountId[accId]] - const getInboxCategory = (accId) => [CategoryStore.getInboxCategory(accId)] + const getSnoozeCategory = (accId) => snoozeCategoriesByAccountId[accId] + const getInboxCategory = (accId) => CategoryStore.getInboxCategory(accId) const description = SnoozeUtils.snoozedUntilMessage(snoozeDate) return SnoozeUtils.moveThreads( threads, @@ -121,8 +120,8 @@ const SnoozeUtils = { moveThreadsFromSnooze(threads, snoozeCategoriesByAccountPromise) { return snoozeCategoriesByAccountPromise .then((snoozeCategoriesByAccountId) => { - const getSnoozeCategory = (accId) => [snoozeCategoriesByAccountId[accId]] - const getInboxCategory = (accId) => [CategoryStore.getInboxCategory(accId)] + const getSnoozeCategory = (accId) => snoozeCategoriesByAccountId[accId] + const getInboxCategory = (accId) => CategoryStore.getInboxCategory(accId) const description = 'Unsnoozed'; return SnoozeUtils.moveThreads( threads,