fix(message-list): allow starring messages by pressing 's'. Fixes T2430.

Summary: Although this code works as desired, I think the code itself could use some work. Also, I didn't know how I should test this. Any ideas? @bengotow

Test Plan: I'm all ears

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: bengotow

Maniphest Tasks: T2430

Differential Revision: https://phab.nylas.com/D1877
This commit is contained in:
dillon 2015-08-12 14:36:44 -07:00
parent 56ad7603b9
commit 50575f1a82

View file

@ -138,10 +138,14 @@ class ThreadListStore extends NylasStore
_onToggleStarFocused: ->
focused = FocusedContentStore.focused('thread')
return unless focused
cursor = FocusedContentStore.keyboardCursor('thread')
if focused
task = new ChangeStarredTask(thread: focused, starred: !focused.starred)
else if cursor
task = new ChangeStarredTask(thread: cursor, starred: !cursor.starred)
task = new ChangeStarredTask(thread: focused, starred: !focused.starred)
Actions.queueTask(task)
if task
Actions.queueTask(task)
_onArchive: ->
@_archiveAndShiftBy('auto')