mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-04 07:10:06 +08:00
fix(important): Resilient against invalid AccountStore state (Sentry 4049)
This commit is contained in:
parent
8b8c333ad8
commit
c914b2701b
1 changed files with 4 additions and 4 deletions
|
@ -13,14 +13,14 @@ class MailImportantIcon extends React.Component
|
|||
thread: React.PropTypes.object
|
||||
|
||||
constructor: (@props) ->
|
||||
@state = @getStateFromStores()
|
||||
@state = @getState()
|
||||
|
||||
getStateFromStores: =>
|
||||
showing: AccountStore.current().usesImportantFlag() and atom.config.get('core.showImportant')
|
||||
getState: =>
|
||||
showing: AccountStore.current()?.usesImportantFlag() and atom.config.get('core.showImportant')
|
||||
|
||||
componentDidMount: =>
|
||||
@subscription = atom.config.observe 'core.showImportant', =>
|
||||
@setState(@getStateFromStores())
|
||||
@setState(@getState())
|
||||
|
||||
componentWillUnmount: =>
|
||||
@subscription?.dispose()
|
||||
|
|
Loading…
Reference in a new issue