We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf67a10 commit 4ccf109Copy full SHA for 4ccf109
packages/shared/src/hooks/usePostModalNavigation.ts
@@ -241,7 +241,9 @@ export const usePostModalNavigation = ({
241
isFetchingNextPage: false,
242
selectedPostIsAd,
243
onCloseModal: async () => {
244
- const searchParams = new URLSearchParams(window.location.search);
+ // Extract query params from baseAsPath to preserve original params like 'id'
245
+ const baseUrl = new URL(baseAsPath, window.location.origin);
246
+ const searchParams = new URLSearchParams(baseUrl.search);
247
248
await router.push(
249
getPathnameWithQuery(basePathname, searchParams),
0 commit comments