mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-19 14:40:26 +08:00
Show window when switching accounts if it isnt visible
This commit is contained in:
parent
50eac609fb
commit
901ce1bcbd
1 changed files with 9 additions and 2 deletions
|
@ -5,15 +5,22 @@ SidebarActions = require './sidebar-actions'
|
|||
|
||||
class SidebarCommands
|
||||
|
||||
@_focusAccounts: (accounts) ->
|
||||
SidebarActions.focusAccounts(accounts)
|
||||
NylasEnv.show() unless NylasEnv.isVisible()
|
||||
|
||||
@_registerCommands: ->
|
||||
commands = {}
|
||||
|
||||
allKey = "application:select-account-0"
|
||||
commands[allKey] = => SidebarActions.focusAccounts(AccountStore.accounts())
|
||||
commands[allKey] = @_focusAccounts.bind(@, AccountStore.accounts())
|
||||
|
||||
[1..8].forEach (index) =>
|
||||
account = AccountStore.accounts()[index - 1]
|
||||
return unless account
|
||||
key = "application:select-account-#{index}"
|
||||
commands[key] = => SidebarActions.focusAccounts([account])
|
||||
commands[key] = @_focusAccounts.bind(@, [account])
|
||||
|
||||
NylasEnv.commands.add('body', commands)
|
||||
|
||||
@_registerMenuItems: ->
|
||||
|
|
Loading…
Reference in a new issue