diff --git a/package.json b/package.json index c84bce878..94874991c 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "i18next-browser-languagedetector": "8.0.0", "next": "14.2.4", "nodemailer": "6.9.14", - "nuqs": "1.17.4", + "nuqs": "2.1.1", "oslo": "1.2.1", "pino": "9.2.0", "pino-pretty": "11.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 14c4f1ce5..af59f32d0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -111,8 +111,8 @@ importers: specifier: 6.9.14 version: 6.9.14 nuqs: - specifier: 1.17.4 - version: 1.17.4(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + specifier: 2.1.1 + version: 2.1.1(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router-dom@5.3.4(react@18.3.1))(react@18.3.1) oslo: specifier: 1.2.1 version: 1.2.1 @@ -7708,10 +7708,20 @@ packages: nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} - nuqs@1.17.4: - resolution: {integrity: sha512-wraphFfKI+Y/aWIGFsld/Ta7fTFEyeya1LkgEGNPDiMuY+Hwea/eVHBiq1GYlyMqTYSAoxRWvQyjCIo1Dy1u7g==} + nuqs@2.1.1: + resolution: {integrity: sha512-iM2H8lMmhvk9bxupUs2oRle9usRNEAqppOkTMXOxD/uK85gOKAubU7T2zmPo8fnYQS4n5e/XswTiq+gLYGpy3w==} peerDependencies: - next: '>=13.4 <14.0.2 || ^14.0.3' + '@remix-run/react': '>= 2' + next: '>= 14.2.0' + react: '>= 18.2.0' + react-router-dom: '>= 6' + peerDependenciesMeta: + '@remix-run/react': + optional: true + next: + optional: true + react-router-dom: + optional: true nwsapi@2.2.10: resolution: {integrity: sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ==} @@ -19372,10 +19382,13 @@ snapshots: dependencies: boolbase: 1.0.0 - nuqs@1.17.4(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)): + nuqs@2.1.1(next@14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-router-dom@5.3.4(react@18.3.1))(react@18.3.1): dependencies: mitt: 3.0.1 + react: 18.3.1 + optionalDependencies: next: 14.2.4(@babel/core@7.24.7)(@playwright/test@1.45.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-router-dom: 5.3.4(react@18.3.1) nwsapi@2.2.10: {} diff --git a/src/app/Document.tsx b/src/app/Document.tsx index f098151b0..452095079 100644 --- a/src/app/Document.tsx +++ b/src/app/Document.tsx @@ -4,6 +4,7 @@ import { ReactNode } from 'react'; import { ColorModeScript } from '@chakra-ui/react'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; +import { NuqsAdapter } from 'nuqs/adapters/next/app'; import { Providers } from '@/app/Providers'; import { Viewport } from '@/components/Viewport'; @@ -63,11 +64,13 @@ export const Document = ({ children }: { children: ReactNode }) => { storageKey={COLOR_MODE_STORAGE_KEY} /> - - {children} - - - + + + {children} + + + + diff --git a/src/features/account/AccountDeleteVerificationCodeModal.tsx b/src/features/account/AccountDeleteVerificationCodeModal.tsx index 9c8caa46d..3da08511f 100644 --- a/src/features/account/AccountDeleteVerificationCodeModal.tsx +++ b/src/features/account/AccountDeleteVerificationCodeModal.tsx @@ -42,11 +42,7 @@ export const AccountDeleteVerificationCodeModale = () => { ); const onClose = () => { - setSearchParams({ - [SEARCH_PARAM_VERIFY_EMAIL]: null, - token: null, - attempts: null, - }); + setSearchParams(null); }; const form = useForm({ diff --git a/src/features/account/EmailVerificationCodeModal.tsx b/src/features/account/EmailVerificationCodeModal.tsx index 598d9a135..06a83f401 100644 --- a/src/features/account/EmailVerificationCodeModal.tsx +++ b/src/features/account/EmailVerificationCodeModal.tsx @@ -35,11 +35,7 @@ export const EmailVerificationCodeModale = () => { const onClose = () => { trpcUtils.account.get.reset(); - setSearchParams({ - verifyEmail: null, - token: null, - attempts: null, - }); + setSearchParams(null); }; const form = useForm({