mirror of
https://github.com/vector-im/element-call.git
synced 2026-02-05 04:15:58 +00:00
Update dependency react-router-dom to v7 (#1624)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
This commit is contained in:
@@ -48,7 +48,7 @@ export const LoginPage: FC = () => {
|
||||
}
|
||||
|
||||
login(homeserver, usernameRef.current.value, passwordRef.current.value)
|
||||
.then(([client, session]) => {
|
||||
.then(async ([client, session]) => {
|
||||
if (!setClient) {
|
||||
return;
|
||||
}
|
||||
@@ -61,9 +61,9 @@ export const LoginPage: FC = () => {
|
||||
if (locationState && locationState.from) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
navigate(locationState.from);
|
||||
await navigate(locationState.from);
|
||||
} else {
|
||||
navigate("/");
|
||||
await navigate("/");
|
||||
}
|
||||
PosthogAnalytics.instance.eventLogin.track();
|
||||
})
|
||||
|
||||
@@ -100,15 +100,15 @@ export const RegisterPage: FC = () => {
|
||||
};
|
||||
|
||||
submit()
|
||||
.then(() => {
|
||||
.then(async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
if (location.state?.from) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
navigate(location.state?.from);
|
||||
await navigate(location.state?.from);
|
||||
} else {
|
||||
navigate("/");
|
||||
await navigate("/");
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -141,7 +141,9 @@ export const RegisterPage: FC = () => {
|
||||
|
||||
useEffect(() => {
|
||||
if (!loading && authenticated && !passwordlessUser && !registering) {
|
||||
navigate("/");
|
||||
navigate("/")?.catch((error) => {
|
||||
logger.error("Failed to navigate to /", error);
|
||||
});
|
||||
}
|
||||
}, [loading, navigate, authenticated, passwordlessUser, registering]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user