#488 fix 401 infinite loading loop (#493)

This commit is contained in:
lenhanphung
2026-02-02 21:38:26 +07:00
committed by GitHub
parent 6014681f29
commit 7d8d6c7a45
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -380,8 +380,8 @@ const CalendarSlice = createSlice({
}) })
// Rejected cases // Rejected cases
.addCase(getCalendarsListAsync.rejected, (state, action) => { .addCase(getCalendarsListAsync.rejected, (state, action) => {
state.pending = false;
if (action.payload?.status !== 401) { if (action.payload?.status !== 401) {
state.pending = false;
state.error = state.error =
action.payload?.message || action.payload?.message ||
action.error.message || action.error.message ||
+1 -1
View File
@@ -179,8 +179,8 @@ export const userSlice = createSlice({
state.loading = true; state.loading = true;
}) })
.addCase(getOpenPaasUserDataAsync.rejected, (state, action) => { .addCase(getOpenPaasUserDataAsync.rejected, (state, action) => {
state.loading = false;
if (action.payload?.status !== 401) { if (action.payload?.status !== 401) {
state.loading = false;
state.error = state.error =
action.payload?.message || "Failed to fetch user information"; action.payload?.message || "Failed to fetch user information";
} }
+1 -1
View File
@@ -49,7 +49,7 @@ export const api = ky.extend({
if (response.status === 401) { if (response.status === 401) {
// Check if we're already on login flow to prevent redirect loop // Check if we're already on login flow to prevent redirect loop
const currentPath = window.location.pathname; const currentPath = window.location.pathname;
if (currentPath === "/" || currentPath === "/callback") { if (currentPath === "/callback") {
return response; return response;
} }