mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 10:12:00 +08:00
fix(menu-icon): Make sure to only show unread state when unread counts have actually changed
This commit is contained in:
parent
f558f05d69
commit
2bca307f34
2 changed files with 7 additions and 4 deletions
|
@ -1,4 +1,3 @@
|
|||
Reflux = require 'reflux'
|
||||
_ = require 'underscore'
|
||||
NylasStore = require 'nylas-store'
|
||||
DatabaseStore = require('./database-store').default
|
||||
|
@ -86,11 +85,11 @@ class ThreadCountsStore extends NylasStore
|
|||
|
||||
_onCountsChanged: =>
|
||||
DatabaseStore._query(ReadCountsQuery()).then (results) =>
|
||||
@_counts = {}
|
||||
nextCounts = {}
|
||||
|
||||
foundNegative = false
|
||||
for {category_id, unread, total} in results
|
||||
@_counts[category_id] = {unread, total}
|
||||
nextCounts[category_id] = {unread, total}
|
||||
if unread < 0 or total < 0
|
||||
foundNegative = true
|
||||
|
||||
|
@ -99,6 +98,10 @@ class ThreadCountsStore extends NylasStore
|
|||
@reset()
|
||||
return
|
||||
|
||||
if _.isEqual(nextCounts, @_counts)
|
||||
return
|
||||
|
||||
@_counts = nextCounts
|
||||
@trigger()
|
||||
|
||||
unreadCountForCategoryId: (catId) =>
|
||||
|
|
2
src/pro
2
src/pro
|
@ -1 +1 @@
|
|||
Subproject commit 498fa1e48ec5bd925eb722307b93e93639500f0f
|
||||
Subproject commit d8a1ebfb136ef181bc95ddcb4f455170ae1936d3
|
Loading…
Reference in a new issue