[thread-search] Fix archiving from search perspective

Summary:
We weren't removing the inbox category in the search perspective, so
things weren't actually being archived.

Test Plan: Run locally

Reviewers: juan, evan

Reviewed By: evan

Maniphest Tasks: T7389

Differential Revision: https://phab.nylas.com/D3575
This commit is contained in:
Mark Hahnenberg 2017-01-03 15:08:23 -08:00
parent 7541db7a65
commit f3caf0b561

View file

@ -1,8 +1,7 @@
import _ from 'underscore'
import {AccountStore, TaskFactory, MailboxPerspective} from 'nylas-exports'
import {AccountStore, CategoryStore, TaskFactory, MailboxPerspective} from 'nylas-exports'
import SearchQuerySubscription from './search-query-subscription'
class SearchMailboxPerspective extends MailboxPerspective {
constructor(accountIds, searchQuery) {
@ -38,6 +37,9 @@ class SearchMailboxPerspective extends MailboxPerspective {
const account = AccountStore.accountForId(accountId)
return [account.defaultFinishedCategory()]
},
categoriesToRemove: (accountId) => {
return [CategoryStore.getInboxCategory(accountId)]
},
})
}
}