mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-07 21:24:24 +08:00
fix(sheets): Always change sheet when changing perspective (#2094)
This commit is contained in:
parent
87c7b5791c
commit
c1a296acf9
3 changed files with 9 additions and 5 deletions
|
@ -93,7 +93,6 @@ class SidebarItem
|
|||
return item.dataTransferType in event.dataTransfer.types
|
||||
|
||||
onSelect: (item) ->
|
||||
Actions.selectRootSheet(WorkspaceStore.Sheet.Threads)
|
||||
Actions.focusMailboxPerspective(item.perspective)
|
||||
}, opts)
|
||||
|
||||
|
@ -141,9 +140,6 @@ class SidebarItem
|
|||
@forDrafts: (accountIds, opts = {}) ->
|
||||
perspective = MailboxPerspective.forDrafts(accountIds)
|
||||
id = "Drafts-#{opts.name}"
|
||||
opts.onSelect = ->
|
||||
Actions.focusMailboxPerspective(perspective)
|
||||
Actions.selectRootSheet(WorkspaceStore.Sheet.Drafts)
|
||||
@forPerspective(id, perspective, opts)
|
||||
|
||||
module.exports = SidebarItem
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
_ = require 'underscore'
|
||||
NylasStore = require 'nylas-store'
|
||||
AccountStore = require './account-store'
|
||||
WorkspaceStore = require './workspace-store'
|
||||
MailboxPerspective = require '../../mailbox-perspective'
|
||||
CategoryStore = require './category-store'
|
||||
Actions = require '../actions'
|
||||
|
@ -76,6 +77,14 @@ class FocusedPerspectiveStore extends NylasStore
|
|||
@_current = perspective
|
||||
@trigger()
|
||||
|
||||
if perspective.drafts
|
||||
desired = WorkspaceStore.Sheet.Drafts
|
||||
else
|
||||
desired = WorkspaceStore.Sheet.Threads
|
||||
|
||||
if desired and WorkspaceStore.rootSheet() isnt desired
|
||||
Actions.selectRootSheet(desired)
|
||||
|
||||
_setPerspectiveByName: (categoryName) ->
|
||||
categories = @_current.accountIds.map (aid) ->
|
||||
CategoryStore.getStandardCategory(aid, categoryName)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
_ = require 'underscore'
|
||||
Actions = require '../actions'
|
||||
AccountStore = require './account-store'
|
||||
FocusedPerspectiveStore = require './focused-perspective-store'
|
||||
CategoryStore = require './category-store'
|
||||
MailboxPerspective = require '../../mailbox-perspective'
|
||||
NylasStore = require 'nylas-store'
|
||||
|
|
Loading…
Add table
Reference in a new issue