Fix missing “new” keyword - weird…

This commit is contained in:
Ben Gotow 2017-08-08 10:01:58 -07:00
parent a15278261f
commit 96eea95903
3 changed files with 9 additions and 10 deletions

View file

@ -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 []

View file

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

View file

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