fix: add validation on build request to prevent output glitch (#7210)

* 📝 (use-post-logout.ts): import Cookies from "react-cookie" to handle cookies in the logout functionality
💡 (use-post-logout.ts): update logic to check for "auto_login_lf" cookie value in addition to autoLogin state before logging out the user

* 📝 (use-post-logout.ts): add constants for IS_AUTO_LOGIN and LANGFLOW_AUTO_LOGIN_OPTION for better code readability and maintainability

* 🐛 (use-get-builds-polling-mutation.ts): fix potential issue where flowPool is undefined before setting it to state
This commit is contained in:
Cristhian Zanforlin Lousa 2025-03-21 13:35:24 -03:00 committed by GitHub
commit 55ee8b4c49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,7 +99,7 @@ export const useGetBuildsMutation: useMutationFunctionType<
const getBuildsFn = async (
payload: IGetBuilds,
): Promise<{ vertex_builds: FlowPoolType }> => {
): Promise<{ vertex_builds: FlowPoolType } | undefined> => {
if (requestInProgressRef.current[payload.flowId]) {
return Promise.reject("Request already in progress");
}
@ -112,7 +112,10 @@ export const useGetBuildsMutation: useMutationFunctionType<
if (currentFlow) {
const flowPool = res?.data?.vertex_builds;
setFlowPool(flowPool);
if (Object.keys(flowPool).length > 0) {
setFlowPool(flowPool);
}
return;
}
return res.data;