mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-04 07:10:06 +08:00
fix(notifs): Categories inside Threads need accountId. Fixes #1155
This commit is contained in:
parent
21ebd82ece
commit
180da72b77
2 changed files with 12 additions and 5 deletions
|
@ -5,6 +5,7 @@ _ = require 'underscore'
|
|||
AccountStore,
|
||||
CategoryStore,
|
||||
SoundRegistry,
|
||||
FocusedPerspectiveStore,
|
||||
NativeNotifications,
|
||||
DatabaseStore} = require 'nylas-exports'
|
||||
|
||||
|
@ -56,9 +57,14 @@ module.exports =
|
|||
else
|
||||
NylasEnv.displayWindow()
|
||||
|
||||
filter = MailboxPerspective.forCategory(thread.categoryNamed('inbox'))
|
||||
currentCategories = FocusedPerspectiveStore.current().categories()
|
||||
desiredCategory = thread.categoryNamed('inbox')
|
||||
|
||||
return unless desiredCategory
|
||||
unless desiredCategory.id in _.pluck(currentCategories, 'id')
|
||||
filter = MailboxPerspective.forCategory(desiredCategory)
|
||||
Actions.focusMailboxPerspective(filter)
|
||||
Actions.setFocus(collection: 'thread', item: thread)
|
||||
Actions.setFocus(collection: 'thread', item: thread)
|
||||
|
||||
_notifyMessages: ->
|
||||
if @stack.length >= 5
|
||||
|
|
|
@ -109,9 +109,10 @@ class Thread extends Model
|
|||
if value
|
||||
@categories = @constructor.attributes.categories.fromJSON(value)
|
||||
|
||||
if @participants
|
||||
for contact in @participants
|
||||
contact.accountId = @accountId
|
||||
for attr in ['participants', 'categories']
|
||||
value = @[attr]
|
||||
continue unless value and value instanceof Array
|
||||
item.accountId = @accountId for item in value
|
||||
|
||||
@
|
||||
|
||||
|
|
Loading…
Reference in a new issue