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

+13 -13
View File
@@ -31,8 +31,8 @@
"@react-spring/web": "^9.7.5", "@react-spring/web": "^9.7.5",
"@tanem/react-nprogress": "^5.0.55", "@tanem/react-nprogress": "^5.0.55",
"@tanstack/react-query": "^5.74.4", "@tanstack/react-query": "^5.74.4",
"@tanstack/react-query-devtools": "^5.74.4", "@tanstack/react-query-devtools": "^5.74.6",
"@tanstack/react-router": "^1.116.0", "@tanstack/react-router": "^1.117.1",
"@tanstack/react-virtual": "^3.13.6", "@tanstack/react-virtual": "^3.13.6",
"@tauri-apps/api": "2.5.0", "@tauri-apps/api": "2.5.0",
"@tauri-apps/plugin-clipboard-manager": "2.2.2", "@tauri-apps/plugin-clipboard-manager": "2.2.2",
@@ -43,13 +43,13 @@
"@tauri-apps/plugin-updater": "2.7.1", "@tauri-apps/plugin-updater": "2.7.1",
"@tauri-apps/plugin-upload": "2.2.1", "@tauri-apps/plugin-upload": "2.2.1",
"@tauri-apps/plugin-window-state": "~2.2.2", "@tauri-apps/plugin-window-state": "~2.2.2",
"@types/node": "^22.14.1", "@types/node": "^22.15.2",
"@types/react": "^19.1.2", "@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2", "@types/react-dom": "^19.1.2",
"axios": "^1.8.4", "axios": "^1.9.0",
"axios-tauri-api-adapter": "^2.0.6", "axios-tauri-api-adapter": "^2.0.6",
"blurhash": "^2.0.5", "blurhash": "^2.0.5",
"framer-motion": "^12.7.4", "framer-motion": "^12.9.2",
"immer": "^10.1.1", "immer": "^10.1.1",
"jassub": "^1.7.18", "jassub": "^1.7.18",
"libpgs": "^0.8.1", "libpgs": "^0.8.1",
@@ -57,11 +57,11 @@
"material-symbols": "^0.31.2", "material-symbols": "^0.31.2",
"million": "^3.1.11", "million": "^3.1.11",
"notistack": "^3.0.2", "notistack": "^3.0.2",
"react": "^18.3.1", "react": "^19.1.0",
"react-blurhash": "^0.3.0", "react-blurhash": "^0.3.0",
"react-dnd": "^16.0.1", "react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1", "react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.3.1", "react-dom": "^19.1.0",
"react-error-boundary": "^5.0.0", "react-error-boundary": "^5.0.0",
"react-intersection-observer": "^9.16.0", "react-intersection-observer": "^9.16.0",
"react-markdown": "^10.1.0", "react-markdown": "^10.1.0",
@@ -76,15 +76,15 @@
"devDependencies": { "devDependencies": {
"@babel/plugin-proposal-optional-chaining-assign": "^7.25.9", "@babel/plugin-proposal-optional-chaining-assign": "^7.25.9",
"@biomejs/biome": "^1.9.4", "@biomejs/biome": "^1.9.4",
"@tanstack/router-cli": "^1.116.0", "@tanstack/router-cli": "^1.117.1",
"@tanstack/router-devtools": "^1.116.0", "@tanstack/router-devtools": "^1.117.1",
"@tanstack/router-vite-plugin": "^1.116.1", "@tanstack/router-vite-plugin": "^1.117.2",
"@tauri-apps/cli": "2.5.0", "@tauri-apps/cli": "2.5.0",
"@types/lodash": "^4.17.16", "@types/lodash": "^4.17.16",
"@vitejs/plugin-react": "^4.4.0", "@vitejs/plugin-react": "^4.4.1",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
"sass": "^1.86.3", "sass": "^1.87.0",
"vite": "^6.2.2" "vite": "^6.3.3"
}, },
"license": "GPL-3.0-only" "license": "GPL-3.0-only"
} }
+411 -392
View File
File diff suppressed because it is too large. Load diff
+2 -3
View File
@@ -21,7 +21,7 @@ export default function NProgress() {
isAnimating, isAnimating,
}); });
return createPortal( return (
<div <div
style={{ style={{
pointerEvents: "none", pointerEvents: "none",
@@ -44,8 +44,7 @@ export default function NProgress() {
variant="determinate" variant="determinate"
/> />
)} )}
</div>, </div>
document.body,
); );
}; };
+1 -1
View File
@@ -44,7 +44,7 @@ export const Route = createRootRouteWithContext<ApiContext>()({
<CssBaseline /> <CssBaseline />
<Settings /> <Settings />
{/* <EasterEgg /> */} {/* <EasterEgg /> */}
<NProgress /> {/* <NProgress /> */}
<RouterLoading /> <RouterLoading />
+15 -14
View File
@@ -6,6 +6,7 @@ import { createFileRoute, redirect } from "@tanstack/react-router";
export const Route = createFileRoute("/_api")({ export const Route = createFileRoute("/_api")({
beforeLoad: async ({ context, location }) => { beforeLoad: async ({ context, location }) => {
console.log("RUNNING API CHECK");
if (!context.api) { if (!context.api) {
const currentServerId = await getDefaultServer(); const currentServerId = await getDefaultServer();
if (currentServerId) { if (currentServerId) {
@@ -55,20 +56,20 @@ export const Route = createFileRoute("/_api")({
} }
} }
} else if (context.api) { } else if (context.api) {
if (context.api.accessToken && location.pathname !== "/login/manual") { // if (context.api.accessToken && location.pathname !== "/login/manual") {
try { // try {
console.info("AccessToken", context.api.accessToken); // console.info("AccessToken", context.api.accessToken);
await getUserApi(context.api).getCurrentUser(); // Verify user is able to authenticate // await getUserApi(context.api).getCurrentUser(); // Verify user is able to authenticate
} catch (error) { // } catch (error) {
console.error(error); // console.error(error);
throw redirect({ // throw redirect({
to: "/login/manual", // to: "/login/manual",
search: { // search: {
redirect: location.href, // redirect: location.href,
}, // },
}); // });
} // }
} // }
} }
}, },
}); });