refactor: update to react 19 and remove NProgress element fixing multiple player instances in videoPlayer
This commit is contained in:
5 files changed
+442
-423
No files matched your search
@@ -21,7 +21,7 @@ export default function NProgress() {
|
||||
isAnimating,
|
||||
});
|
||||
|
||||
return createPortal(
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
pointerEvents: "none",
|
||||
@@ -44,8 +44,7 @@ export default function NProgress() {
|
||||
variant="determinate"
|
||||
/>
|
||||
)}
|
||||
</div>,
|
||||
document.body,
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ export const Route = createRootRouteWithContext<ApiContext>()({
|
||||
<CssBaseline />
|
||||
<Settings />
|
||||
{/* <EasterEgg /> */}
|
||||
<NProgress />
|
||||
{/* <NProgress /> */}
|
||||
|
||||
<RouterLoading />
|
||||
|
||||
|
||||
+15
-14
@@ -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,
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
}
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user