fix(unread): Mark as read twice without visiting another unread thread

This commit is contained in:
Ben Gotow 2016-01-12 17:14:17 -08:00
parent e87766ebd5
commit b44ab5670b

View file

@ -163,10 +163,11 @@ class MessageStore extends NylasStore
# Override canBeUndone to return false so that we don't see undo
# prompts (since this is a passive action vs. a user-triggered
# action.)
return unless @_thread and @_thread.unread
return if not @_thread
return if @_lastLoadedThreadId is @_thread.id
@_lastLoadedThreadId = @_thread.id
if @_thread.unread
markAsReadDelay = NylasEnv.config.get('core.reading.markAsReadDelay')
markAsReadId = @_thread.id
return if markAsReadDelay < 0