fix(labels): Never show labels UX for threads split across folders

This commit is contained in:
Ben Gotow 2016-01-28 16:57:20 -08:00
parent 12b60e4360
commit 9dab8d6335

View file

@ -9,6 +9,7 @@ classNames = require 'classnames'
InjectedComponentSet} = require 'nylas-component-kit'
{Thread,
AccountStore,
CategoryStore,
FocusedPerspectiveStore} = require 'nylas-exports'
@ -64,18 +65,19 @@ c3 = new ListTabular.Column
resolver: (thread) =>
attachment = []
labels = []
if thread.hasAttachments
attachment = <div className="thread-icon thread-icon-attachment"></div>
currentCategories = FocusedPerspectiveStore.current().categories() ? []
if AccountStore.accountForId(thread.accountId).usesLabels()
currentCategories = FocusedPerspectiveStore.current().categories() ? []
ignored = [].concat(currentCategories, CategoryStore.hiddenCategories(thread.accountId))
ignoredIds = _.pluck(ignored, 'id')
ignored = [].concat(currentCategories, CategoryStore.hiddenCategories(thread.accountId))
ignoredIds = _.pluck(ignored, 'id')
for label in (thread.sortedCategories())
continue if label.id in ignoredIds
c3LabelComponentCache[label.id] ?= <MailLabel label={label} key={label.id} />
labels.push c3LabelComponentCache[label.id]
for label in (thread.sortedCategories())
continue if label.id in ignoredIds
c3LabelComponentCache[label.id] ?= <MailLabel label={label} key={label.id} />
labels.push c3LabelComponentCache[label.id]
<span className="details">
{labels}