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,
|
processFlows,
|
||||||
} from "@/utils/reactflowUtils";
|
} from "@/utils/reactflowUtils";
|
||||||
import { UseQueryOptions } from "@tanstack/react-query";
|
import { UseQueryOptions } from "@tanstack/react-query";
|
||||||
|
import { AxiosError } from "axios";
|
||||||
import { api } from "../../api";
|
import { api } from "../../api";
|
||||||
import { getURL } from "../../helpers/constants";
|
import { getURL } from "../../helpers/constants";
|
||||||
import { UseRequestProcessor } from "../../services/request-processor";
|
import { UseRequestProcessor } from "../../services/request-processor";
|
||||||
|
|
@ -74,9 +75,11 @@ export const useGetRefreshFlowsQuery: useQueryFunctionType<
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setErrorData({
|
if (e instanceof AxiosError && e.status !== 403) {
|
||||||
title: "Could not load flows from database",
|
setErrorData({
|
||||||
});
|
title: "Could not load flows from database",
|
||||||
|
});
|
||||||
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import {
|
||||||
processFlows,
|
processFlows,
|
||||||
} from "@/utils/reactflowUtils";
|
} from "@/utils/reactflowUtils";
|
||||||
import { UseMutationOptions } from "@tanstack/react-query";
|
import { UseMutationOptions } from "@tanstack/react-query";
|
||||||
|
import { AxiosError } from "axios";
|
||||||
import { api } from "../../api";
|
import { api } from "../../api";
|
||||||
import { getURL } from "../../helpers/constants";
|
import { getURL } from "../../helpers/constants";
|
||||||
import { UseRequestProcessor } from "../../services/request-processor";
|
import { UseRequestProcessor } from "../../services/request-processor";
|
||||||
|
|
@ -77,9 +78,11 @@ export const useGetRefreshFlows: useMutationFunctionType<
|
||||||
|
|
||||||
return [];
|
return [];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setErrorData({
|
if (e instanceof AxiosError && e.status !== 403) {
|
||||||
title: "Could not load flows from database",
|
setErrorData({
|
||||||
});
|
title: "Could not load flows from database",
|
||||||
|
});
|
||||||
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue