diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 114a99381..bd5306ff4 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -11,7 +11,7 @@ "lint": "eslint src --cache" }, "dependencies": { - "@remix-run/router": "^1.11.0", + "@remix-run/router": "^1.13.1", "@rspc/client": "=0.0.0-main-799eec5d", "@rspc/tauri": "=0.0.0-main-799eec5d", "@sd/client": "workspace:*", @@ -23,7 +23,7 @@ "immer": "^10.0.3", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "6.18.0", + "react-router-dom": "6.20.1", "sonner": "^1.0.3" }, "devDependencies": { diff --git a/apps/web/package.json b/apps/web/package.json index a1b956c1c..0a5a3f179 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -19,7 +19,7 @@ "html2canvas": "^1.4.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "6.18.0" + "react-router-dom": "6.20.1" }, "devDependencies": { "@playwright/test": "^1.39.0", diff --git a/interface/app/$libraryId/index.tsx b/interface/app/$libraryId/index.tsx index 77b89f949..a49947345 100644 --- a/interface/app/$libraryId/index.tsx +++ b/interface/app/$libraryId/index.tsx @@ -59,7 +59,9 @@ export default (platform: Platform) => loader: async () => { if (!platform.userHomeDir) return null; const homeDir = await platform.userHomeDir(); - return redirect(`ephemeral/0?${new URLSearchParams({ path: homeDir })}`); + return redirect(`ephemeral/0?${new URLSearchParams({ path: homeDir })}`, { + replace: true + }); } }, topBarRoutes, diff --git a/interface/app/index.tsx b/interface/app/index.tsx index f0e3ae68f..48c1022c9 100644 --- a/interface/app/index.tsx +++ b/interface/app/index.tsx @@ -66,9 +66,10 @@ export const createRoutes = (platform: Platform, cache: NormalisedCache) => const libraryId = currentLibrary ? currentLibrary.uuid : libraries[0]?.uuid; - if (libraryId === undefined) return redirect('/onboarding'); + if (libraryId === undefined) + return redirect('/onboarding', { replace: true }); - return redirect(`/${libraryId}`); + return redirect(`/${libraryId}`, { replace: true }); } }, { @@ -86,8 +87,9 @@ export const createRoutes = (platform: Platform, cache: NormalisedCache) => if (!library) { const firstLibrary = libraries[0]; - if (firstLibrary) return redirect(`/${firstLibrary.uuid}`); - else return redirect('/onboarding'); + if (firstLibrary) + return redirect(`/${firstLibrary.uuid}`, { replace: true }); + else return redirect('/onboarding', { replace: true }); } return null; diff --git a/interface/app/onboarding/index.tsx b/interface/app/onboarding/index.tsx index 214da3694..d7df4e664 100644 --- a/interface/app/onboarding/index.tsx +++ b/interface/app/onboarding/index.tsx @@ -25,9 +25,11 @@ export default [ index: true, loader: () => { if (getOnboardingStore().lastActiveScreen) - return redirect(`/onboarding/${getOnboardingStore().lastActiveScreen}`); + return redirect(`/onboarding/${getOnboardingStore().lastActiveScreen}`, { + replace: true + }); - return redirect(`/onboarding/alpha`); + return redirect(`/onboarding/alpha`, { replace: true }); }, element: }, diff --git a/interface/package.json b/interface/package.json index 5d525cf46..05b9ff2fb 100644 --- a/interface/package.json +++ b/interface/package.json @@ -20,7 +20,7 @@ "@radix-ui/react-toast": "^1.1.2", "@radix-ui/react-tooltip": "^1.0.2", "@redux-devtools/extension": "^3.2.5", - "@remix-run/router": "^1.4.0", + "@remix-run/router": "^1.13.1", "@sd/assets": "workspace:*", "@sd/client": "workspace:*", "@sd/ui": "workspace:*", @@ -48,8 +48,8 @@ "react-json-view": "^1.21.3", "react-loading-skeleton": "^3.3.1", "react-markdown": "^9.0.0", - "react-router": "6.18.0", - "react-router-dom": "6.18.0", + "react-router": "6.20.1", + "react-router-dom": "6.20.1", "react-selecto": "^1.26.0", "react-slidedown": "^2.4.7", "react-sticky-el": "^2.1.0", diff --git a/package.json b/package.json index 8b567590e..d0efd07ec 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,9 @@ "pnpm": { "overrides": { "@radix-ui/react-dismissable-layer": "1.0.2" + }, + "patchedDependencies": { + "@remix-run/router@1.13.1": "patches/@remix-run__router@1.13.1.patch" } }, "devDependencies": { diff --git a/packages/ui/package.json b/packages/ui/package.json index e043b60e4..563e3c205 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -40,7 +40,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-loading-icons": "^1.1.0", - "react-router-dom": "6.18.0", + "react-router-dom": "6.20.1", "sonner": "^1.0.3", "use-debounce": "^9.0.4", "zod": "~3.22.4" diff --git a/patches/@remix-run__router@1.13.1.patch b/patches/@remix-run__router@1.13.1.patch new file mode 100644 index 000000000..5aeb8f18a Binary files /dev/null and b/patches/@remix-run__router@1.13.1.patch differ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6c6a1fccb..4aa85f673 100644 Binary files a/pnpm-lock.yaml and b/pnpm-lock.yaml differ