From 41d3526b12b26c8139381744a464384db77fa0be Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 18:27:48 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/archive.index.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/routes/archive.index.tsx b/src/routes/archive.index.tsx index 2b7ede3..b5d8b1a 100644 --- a/src/routes/archive.index.tsx +++ b/src/routes/archive.index.tsx @@ -62,6 +62,24 @@ function ArchivePage() { const [totalCount, setTotalCount] = useState(0); const [uploadOpen, setUploadOpen] = useState(false); const [newCatOpen, setNewCatOpen] = useState(false); + const [lockedTabs, setLockedTabs] = useState>(() => { + if (typeof window === "undefined") return {}; + try { + return JSON.parse(localStorage.getItem("archive-locked-tabs") || "{}"); + } catch { + return {}; + } + }); + const isLocked = activeId ? lockedTabs[activeId] !== false : true; // default locked + const toggleLock = () => { + if (!activeId) return; + const next = { ...lockedTabs, [activeId]: !isLocked }; + setLockedTabs(next); + try { + localStorage.setItem("archive-locked-tabs", JSON.stringify(next)); + } catch {} + toast.success(next[activeId] ? "Tab locked" : "Tab unlocked"); + }; // Debounce search input (300ms) useEffect(() => {