Fix: Prevent Error Popups When Session Expires During Logout (#7455)
🔧 (use-get-refresh-flows-query.ts, use-get-refresh-flows.ts): Add check for AxiosError status to handle specific error case and set error message accordingly.
This commit is contained in:
parent
823b9448d3
commit
b2c74173b5
2 changed files with 12 additions and 6 deletions
|
|
@ -9,6 +9,7 @@ import {
|
|||
processFlows,
|
||||
} from "@/utils/reactflowUtils";
|
||||
import { UseQueryOptions } from "@tanstack/react-query";
|
||||
import { AxiosError } from "axios";
|
||||
import { api } from "../../api";
|
||||
import { getURL } from "../../helpers/constants";
|
||||
import { UseRequestProcessor } from "../../services/request-processor";
|
||||
|
|
@ -74,9 +75,11 @@ export const useGetRefreshFlowsQuery: useQueryFunctionType<
|
|||
|
||||
return [];
|
||||
} catch (e) {
|
||||
setErrorData({
|
||||
title: "Could not load flows from database",
|
||||
});
|
||||
if (e instanceof AxiosError && e.status !== 403) {
|
||||
setErrorData({
|
||||
title: "Could not load flows from database",
|
||||
});
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import {
|
|||
processFlows,
|
||||
} from "@/utils/reactflowUtils";
|
||||
import { UseMutationOptions } from "@tanstack/react-query";
|
||||
import { AxiosError } from "axios";
|
||||
import { api } from "../../api";
|
||||
import { getURL } from "../../helpers/constants";
|
||||
import { UseRequestProcessor } from "../../services/request-processor";
|
||||
|
|
@ -77,9 +78,11 @@ export const useGetRefreshFlows: useMutationFunctionType<
|
|||
|
||||
return [];
|
||||
} catch (e) {
|
||||
setErrorData({
|
||||
title: "Could not load flows from database",
|
||||
});
|
||||
if (e instanceof AxiosError && e.status !== 403) {
|
||||
setErrorData({
|
||||
title: "Could not load flows from database",
|
||||
});
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue