diff --git a/CHANGELOG.md b/CHANGELOG.md index 300e1e87..16ddaa2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## v2.6.2 +- ⚡️ Advanced search: Maintain search params during navigation #195 - 🦺 Torrent streaming: Fixed playback issue - 🦺 Auto Downloader: Fixed list not updating correctly after batch creation - 🔧 Torrent streaming: Reverted to using separate streaming server diff --git a/seanime-web/src/app/(main)/search/_lib/advanced-search.atoms.ts b/seanime-web/src/app/(main)/search/_lib/advanced-search.atoms.ts index 6fe0cf47..e733dc60 100644 --- a/seanime-web/src/app/(main)/search/_lib/advanced-search.atoms.ts +++ b/seanime-web/src/app/(main)/search/_lib/advanced-search.atoms.ts @@ -17,7 +17,7 @@ type Params = { } export const __advancedSearch_paramsAtom = atomWithImmer({ - active: false, + active: true, title: null, sorting: null, status: null, diff --git a/seanime-web/src/app/(main)/search/page.tsx b/seanime-web/src/app/(main)/search/page.tsx index ccf6ee94..512d855e 100644 --- a/seanime-web/src/app/(main)/search/page.tsx +++ b/seanime-web/src/app/(main)/search/page.tsx @@ -29,20 +29,22 @@ export default function Page() { const setParams = useSetAtom(__advancedSearch_paramsAtom) useMount(() => { - setParams({ - active: true, - title: null, - sorting: sortingUrlParam ? [sortingUrlParam as AL_MediaSort] : null, - status: statusUrlParam ? [statusUrlParam as AL_MediaStatus] : null, - genre: genreUrlParam ? [genreUrlParam] : null, - format: (formatUrlParam as AL_MediaFormat) === "MANGA" ? null : (formatUrlParam as AL_MediaFormat), - season: (seasonUrlParam as AL_MediaSeason) || null, - year: yearUrlParam || null, - minScore: null, - isAdult: false, - countryOfOrigin: null, - type: (formatUrlParam as AL_MediaFormat) === "MANGA" ? "manga" : (typeUrlParam as "anime" | "manga") || "anime", - }) + if (sortingUrlParam || genreUrlParam || statusUrlParam || formatUrlParam || seasonUrlParam || yearUrlParam || typeUrlParam) { + setParams({ + active: true, + title: null, + sorting: sortingUrlParam ? [sortingUrlParam as AL_MediaSort] : null, + status: statusUrlParam ? [statusUrlParam as AL_MediaStatus] : null, + genre: genreUrlParam ? [genreUrlParam] : null, + format: (formatUrlParam as AL_MediaFormat) === "MANGA" ? null : (formatUrlParam as AL_MediaFormat), + season: (seasonUrlParam as AL_MediaSeason) || null, + year: yearUrlParam || null, + minScore: null, + isAdult: false, + countryOfOrigin: null, + type: (formatUrlParam as AL_MediaFormat) === "MANGA" ? "manga" : (typeUrlParam as "anime" | "manga") || "anime", + }) + } }) return (