fix: show auth error when no token set

This commit is contained in:
EnixCoda 2020-06-21 14:40:04 +08:00
parent c9bc97aa4a
commit 1691e28a06
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD

View file

@ -141,7 +141,12 @@ export const handleError: BoundMethodCreator<[Error]> = dispatch => async err =>
) {
dispatch.set({ errorDueToAuth: true })
} else if (err.message === errors.CONNECTION_BLOCKED) {
dispatch.call(setError, `Cannot connect to ${platformName}.`)
const [, props] = dispatch.get()
if (props.configContext.val.access_token) {
dispatch.call(setError, `Cannot connect to ${platformName}.`)
} else {
dispatch.set({ errorDueToAuth: true })
}
} else if (err.message === errors.SERVER_FAULT) {
dispatch.call(setError, `${platformName} server went down.`)
} else {