[ENG-1493] Fix navigation buttons with @remix-run/router patch (#1871)

* patch @remix-run/router

* add replace to a bunch of redirects

* updates + lockfile
This commit is contained in:
Brendan Allan 2023-12-07 19:10:38 +11:00 committed by GitHub
parent e4d21b001c
commit 1db2a4eccc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 2531 additions and 246 deletions

View file

@ -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": {

View file

@ -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",

View file

@ -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,

View file

@ -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;

View file

@ -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: <Index />
},

View file

@ -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",

View file

@ -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": {

View file

@ -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"

Binary file not shown.

File diff suppressed because it is too large Load diff