mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 00:06:06 +08:00
Remove current()? references, use Perspectiv.forNothing instead
This commit is contained in:
parent
f1b4a23897
commit
99854add72
|
@ -13,7 +13,7 @@ class ThreadArchiveButton extends React.Component
|
|||
thread: React.PropTypes.object.isRequired
|
||||
|
||||
render: =>
|
||||
return false unless FocusedPerspectiveStore.current()?.canArchiveThreads()
|
||||
return false unless FocusedPerspectiveStore.current().canArchiveThreads()
|
||||
|
||||
<button className="btn btn-toolbar btn-archive"
|
||||
style={order: -107}
|
||||
|
|
|
@ -28,7 +28,7 @@ class SearchSuggestionStore extends NylasStore
|
|||
@listenTo SearchActions.searchBlurred, @_onSearchBlurred
|
||||
|
||||
_onPerspectiveChanged: =>
|
||||
@_searchQuery = FocusedPerspectiveStore.current()?.searchQuery ? ""
|
||||
@_searchQuery = FocusedPerspectiveStore.current().searchQuery ? ""
|
||||
@trigger()
|
||||
|
||||
_onQueryChanged: (query) =>
|
||||
|
|
|
@ -25,7 +25,7 @@ class DraftListStore extends NylasStore
|
|||
|
||||
_queryForCurrentAccount: =>
|
||||
matchers = [Message.attributes.draft.equal(true)]
|
||||
account = FocusedPerspectiveStore.current()?.account
|
||||
account = FocusedPerspectiveStore.current().account
|
||||
|
||||
if account?
|
||||
matchers.push(Message.attributes.accountId.equal(account.id))
|
||||
|
|
|
@ -41,19 +41,16 @@ class CategoryStore extends NylasStore
|
|||
# Public: Returns all of the standard categories for the current account.
|
||||
#
|
||||
standardCategories: (accountOrId) ->
|
||||
return [] unless accountOrId
|
||||
@_standardCategories[asAccountId(accountOrId)]
|
||||
@_standardCategories[asAccountId(accountOrId)] ? []
|
||||
|
||||
hiddenCategories: (accountOrId) ->
|
||||
return [] unless accountOrId
|
||||
@_hiddenCategories[asAccountId(accountOrId)]
|
||||
@_hiddenCategories[asAccountId(accountOrId)] ? []
|
||||
|
||||
# Public: Returns all of the categories that are not part of the standard
|
||||
# category set.
|
||||
#
|
||||
userCategories: (accountOrId) ->
|
||||
return [] unless accountOrId
|
||||
@_userCategories[asAccountId(accountOrId)]
|
||||
@_userCategories[asAccountId(accountOrId)] ? []
|
||||
|
||||
# Public: Returns the Folder or Label object for a standard category name and
|
||||
# for a given account.
|
||||
|
|
|
@ -370,7 +370,7 @@ class DraftStore
|
|||
|
||||
_onPopoutBlankDraft: =>
|
||||
# TODO Remove this when we add account selector inside composer
|
||||
account = FocusedPerspectiveStore.current()?.account
|
||||
account = FocusedPerspectiveStore.current().account
|
||||
account ?= AccountStore.accounts()[0]
|
||||
|
||||
draft = new Message
|
||||
|
@ -408,7 +408,7 @@ class DraftStore
|
|||
|
||||
_onHandleMailtoLink: (event, urlString) =>
|
||||
# TODO Remove this when we add account selector inside composer
|
||||
account = FocusedPerspectiveStore.current()?.account
|
||||
account = FocusedPerspectiveStore.current().account
|
||||
account ?= AccountStore.accounts()[0]
|
||||
|
||||
try
|
||||
|
|
|
@ -25,7 +25,7 @@ class UnreadBadgeStore extends NylasStore
|
|||
@_count
|
||||
|
||||
_updateCount: =>
|
||||
account = FocusedPerspectiveStore.current()?.account
|
||||
account = FocusedPerspectiveStore.current().account
|
||||
category = CategoryStore.getStandardCategory(account, 'inbox')
|
||||
if category
|
||||
count = ThreadCountsStore.unreadCountForCategoryId(category.id) ? 0
|
||||
|
|
|
@ -55,7 +55,7 @@ class WorkspaceStore extends NylasStore
|
|||
'navigation:go-to-label' : => ## TODO
|
||||
|
||||
_setMailViewByName: (categoryName) ->
|
||||
account = FocusedPerspectiveStore.current()?.account
|
||||
account = FocusedPerspectiveStore.current().account
|
||||
category = CategoryStore.getStandardCategory(account, categoryName)
|
||||
return unless category
|
||||
view = MailboxPerspective.forCategory(category)
|
||||
|
|
Loading…
Reference in a new issue