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:
parent
1153a301c6
commit
55ee8b4c49
1 changed files with 5 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue