fix(sentry-2518): Better debugging information for when token is not found

This commit is contained in:
Ben Gotow 2015-08-25 11:49:51 -07:00
parent 27181d177e
commit 2c6e3c4db5

View file

@ -107,10 +107,14 @@ class PreferencesAccounts extends React.Component
return [] unless @props.config
tokens = @props.config.get('tokens') || []
token = _.find tokens, (token) ->
token.provider is 'nylas' and token.identifier is account.emailAddress
token = _.find tokens, (t) ->
t.provider is 'nylas' and t.identifier is account.emailAddress
tokens = _.without(tokens, token)
if not token
console.warn("Could not find nylas token for email address #{account.emailAddress}")
return
DatabaseStore.unpersistModel(account).then =>
# TODO: Delete other mail data
EdgehillAPI.unlinkToken(token)