chore(authContext.tsx): add console log statement for error handling in the catch block of the promise
fix(EditNodeModal/index.tsx): add key prop to BaseModal component to fix React warning chore(formModal/index.tsx): add console log statement for error handling in the onerror event handler chore(LoginPage/index.tsx): add console log statement for error handling in the catch block of the promise chore(loginPage/index.tsx): add console log statement for error handling in the catch block of the promise
This commit is contained in:
parent
117d5acbf5
commit
9352a07571
5 changed files with 12 additions and 16 deletions
|
|
@ -66,7 +66,9 @@ export function AuthProvider({ children }): React.ReactElement {
|
||||||
const isSuperUser = user!.is_superuser;
|
const isSuperUser = user!.is_superuser;
|
||||||
setIsAdmin(isSuperUser);
|
setIsAdmin(isSuperUser);
|
||||||
})
|
})
|
||||||
.catch((error) => {});
|
.catch((error) => {
|
||||||
|
console.log("auth context");
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,7 @@ const EditNodeModal = forwardRef(
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseModal
|
<BaseModal
|
||||||
|
key={data.id}
|
||||||
size="large-h-full"
|
size="large-h-full"
|
||||||
open={modalOpen}
|
open={modalOpen}
|
||||||
setOpen={setModalOpen}
|
setOpen={setModalOpen}
|
||||||
|
|
|
||||||
|
|
@ -297,18 +297,8 @@ export default function FormModal({
|
||||||
handleOnClose(event);
|
handleOnClose(event);
|
||||||
};
|
};
|
||||||
newWs.onerror = (ev) => {
|
newWs.onerror = (ev) => {
|
||||||
if (flow.id === "") {
|
console.log(ev);
|
||||||
connectWS();
|
connectWS();
|
||||||
} else {
|
|
||||||
setErrorData({
|
|
||||||
title: "There was an error on web connection, please: ",
|
|
||||||
list: [
|
|
||||||
"Refresh the page",
|
|
||||||
"Use a new flow tab",
|
|
||||||
"Check if the backend is up",
|
|
||||||
],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
ws.current = newWs;
|
ws.current = newWs;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -430,7 +420,6 @@ export default function FormModal({
|
||||||
setChatValue("");
|
setChatValue("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onOpenChange={setOpen}>
|
<Dialog open={open} onOpenChange={setOpen}>
|
||||||
<DialogTrigger hidden></DialogTrigger>
|
<DialogTrigger hidden></DialogTrigger>
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,9 @@ export default function LoginAdminPage() {
|
||||||
.then((user) => {
|
.then((user) => {
|
||||||
setUserData(user);
|
setUserData(user);
|
||||||
})
|
})
|
||||||
.catch((error) => {});
|
.catch((error) => {
|
||||||
|
console.log("login admin page");
|
||||||
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,9 @@ export default function LoginPage(): JSX.Element {
|
||||||
setIsAdmin(isSuperUser);
|
setIsAdmin(isSuperUser);
|
||||||
setUserData(user);
|
setUserData(user);
|
||||||
})
|
})
|
||||||
.catch((error) => {});
|
.catch((error) => {
|
||||||
|
console.log("login page");
|
||||||
|
});
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue