Skip to content

Commit

Permalink
fix: non-awaited error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
m8vago committed Sep 21, 2023
1 parent 01de6ab commit 65367ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/crux-ui/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ export const wsErrorHandler = (translator: Translator) => (message: WsErrorMessa
toaster(translation.toast)
}

export const defaultWsErrorHandler = (t: Translate, router: NextRouter) => (msg: WsErrorMessage) => {
export const defaultWsErrorHandler = (t: Translate, router: NextRouter) => async (msg: WsErrorMessage) => {
const defaultErrorHandler = wsErrorHandler(defaultTranslator(t))
if (msg.status === WebSocketClient.ERROR_UNAUTHORIZE) {
router.push(ROUTE_LOGIN)
await router.push(ROUTE_LOGIN)
return
}
defaultErrorHandler(msg)
Expand Down

0 comments on commit 65367ab

Please sign in to comment.