mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 07:46:06 +08:00
fix(sentry-2518): Better debugging information for when token is not found
This commit is contained in:
parent
78c8b85558
commit
65361251b1
|
@ -107,10 +107,14 @@ class PreferencesAccounts extends React.Component
|
||||||
return [] unless @props.config
|
return [] unless @props.config
|
||||||
|
|
||||||
tokens = @props.config.get('tokens') || []
|
tokens = @props.config.get('tokens') || []
|
||||||
token = _.find tokens, (token) ->
|
token = _.find tokens, (t) ->
|
||||||
token.provider is 'nylas' and token.identifier is account.emailAddress
|
t.provider is 'nylas' and t.identifier is account.emailAddress
|
||||||
tokens = _.without(tokens, token)
|
tokens = _.without(tokens, token)
|
||||||
|
|
||||||
|
if not token
|
||||||
|
console.warn("Could not find nylas token for email address #{account.emailAddress}")
|
||||||
|
return
|
||||||
|
|
||||||
DatabaseStore.unpersistModel(account).then =>
|
DatabaseStore.unpersistModel(account).then =>
|
||||||
# TODO: Delete other mail data
|
# TODO: Delete other mail data
|
||||||
EdgehillAPI.unlinkToken(token)
|
EdgehillAPI.unlinkToken(token)
|
||||||
|
|
Loading…
Reference in a new issue