From 9dab8d63357dad768346c969d5962d557ce9f7c1 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Thu, 28 Jan 2016 16:57:20 -0800 Subject: [PATCH] fix(labels): Never show labels UX for threads split across folders --- .../thread-list/lib/thread-list-columns.cjsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/internal_packages/thread-list/lib/thread-list-columns.cjsx b/internal_packages/thread-list/lib/thread-list-columns.cjsx index 5ed95461b..765dc86aa 100644 --- a/internal_packages/thread-list/lib/thread-list-columns.cjsx +++ b/internal_packages/thread-list/lib/thread-list-columns.cjsx @@ -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 =
- 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] ?= - labels.push c3LabelComponentCache[label.id] + for label in (thread.sortedCategories()) + continue if label.id in ignoredIds + c3LabelComponentCache[label.id] ?= + labels.push c3LabelComponentCache[label.id] {labels}