diff --git a/client/src/store/sagas/failure.ts b/client/src/store/sagas/failure.ts index d37a20a..24e6fb5 100644 --- a/client/src/store/sagas/failure.ts +++ b/client/src/store/sagas/failure.ts @@ -3,8 +3,7 @@ import { put } from 'redux-saga/effects'; import { logout } from '../actions/logout'; export function* failuresSaga(action) { - const err = action.error; - if (err instanceof GiteaUnauthorizedError) { + if (action.error instanceof GiteaUnauthorizedError) { yield put(logout()); } } diff --git a/client/src/util/gitea.ts b/client/src/util/gitea.ts index 8cfd785..faff29b 100644 --- a/client/src/util/gitea.ts +++ b/client/src/util/gitea.ts @@ -2,6 +2,7 @@ export class GiteaUnauthorizedError extends Error { constructor(...args: any[]) { super(...args) + Object.setPrototypeOf(this, GiteaUnauthorizedError.prototype); } }