refactor: update to react 19 and remove NProgress element fixing multiple player instances in videoPlayer

This commit is contained in:
Prayag Prajapati committed 2025-04-25 21:43:24 +05:30
1 parent 80080e841a
commit 18ebe4ef1e
5 files changed
+442 -423

No files matched your search

+15 -14
View File
@@ -6,6 +6,7 @@ import { createFileRoute, redirect } from "@tanstack/react-router";
export const Route = createFileRoute("/_api")({
beforeLoad: async ({ context, location }) => {
console.log("RUNNING API CHECK");
if (!context.api) {
const currentServerId = await getDefaultServer();
if (currentServerId) {
@@ -55,20 +56,20 @@ export const Route = createFileRoute("/_api")({
}
}
} else if (context.api) {
if (context.api.accessToken && location.pathname !== "/login/manual") {
try {
console.info("AccessToken", context.api.accessToken);
await getUserApi(context.api).getCurrentUser(); // Verify user is able to authenticate
} catch (error) {
console.error(error);
throw redirect({
to: "/login/manual",
search: {
redirect: location.href,
},
});
}
}
// if (context.api.accessToken && location.pathname !== "/login/manual") {
// try {
// console.info("AccessToken", context.api.accessToken);
// await getUserApi(context.api).getCurrentUser(); // Verify user is able to authenticate
// } catch (error) {
// console.error(error);
// throw redirect({
// to: "/login/manual",
// search: {
// redirect: location.href,
// },
// });
// }
// }
}
},
});