diff --git a/src/redux/user/sagas.ts b/src/redux/user/sagas.ts index ee79778..d6bf860 100644 --- a/src/redux/user/sagas.ts +++ b/src/redux/user/sagas.ts @@ -1,4 +1,4 @@ -import { REHYDRATE } from "redux-persist"; +import { REHYDRATE, RehydrateAction } from "redux-persist"; import { delay, SagaIterator } from "redux-saga"; import { takeLatest, @@ -253,7 +253,9 @@ function* mapInitSaga() { return true; } -function* authCheckSaga() { +function* authCheckSaga({ key }: RehydrateAction) { + if (key !== 'user') return; + pushLoaderState(70); const { id, token } = yield select(getUser); @@ -291,6 +293,7 @@ function* authCheckSaga() { return yield call(mapInitSaga); } else if (!ready) { pushNetworkInitError(); + return; } } diff --git a/src/utils/history.ts b/src/utils/history.ts index 1db47a8..a1ce63f 100644 --- a/src/utils/history.ts +++ b/src/utils/history.ts @@ -40,7 +40,6 @@ export const pushLoaderState = (state: number) => { }; export const countDownToRefresh = (left: number = API_RETRY_INTERVAL): void => { - console.log('countdown'); if (left <= 0) return document.location.reload(); document.getElementById('loader-bar').style.width = `${(left / API_RETRY_INTERVAL) * 100}%`; diff --git a/tsconfig.json b/tsconfig.json index 2e5ace5..4344f6f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,7 +26,7 @@ } }, "include": [ - "./src/**/*", + "./src/index.tsx", "./backend/**/*", "./custom.d.ts" ]