From 3411694cdab09078d846fa21a41394ce65ab4602 Mon Sep 17 00:00:00 2001 From: Chris Amico Date: Mon, 16 Dec 2024 15:37:54 -0500 Subject: [PATCH] Preserve search params when navigating within the viewer --- src/lib/components/common/Tab.svelte | 8 +++- .../components/viewer/ReadingToolbar.svelte | 24 ++++++----- src/lib/components/viewer/Search.svelte | 18 ++++---- src/lib/utils/navigation.ts | 22 ++++++++++ src/lib/utils/tests/navigation.test.ts | 41 ++++++++++++++++++- 5 files changed, 93 insertions(+), 20 deletions(-) diff --git a/src/lib/components/common/Tab.svelte b/src/lib/components/common/Tab.svelte index 5de14d60a..7cb47d291 100644 --- a/src/lib/components/common/Tab.svelte +++ b/src/lib/components/common/Tab.svelte @@ -1,4 +1,10 @@ + @@ -103,9 +107,7 @@ Assumes it's a child of a ViewerContext - {Array.from(readModeDropdownItems ?? []).find( - ([value]) => value === $mode, - )?.[1]} + {current} diff --git a/src/lib/components/viewer/Search.svelte b/src/lib/components/viewer/Search.svelte index 4521f7309..3d88c13ee 100644 --- a/src/lib/components/viewer/Search.svelte +++ b/src/lib/components/viewer/Search.svelte @@ -3,13 +3,14 @@ Assumes it's a child of a ViewerContext -->