From 1133a910780e9b6acfc4d0bfc9cce8990313a802 Mon Sep 17 00:00:00 2001 From: maxime Date: Thu, 19 Nov 2026 11:27:00 +0100 Subject: [PATCH] Stations: the choice Data / Differential images kept for the browser tab (sessionStorage), so that back on the page the running diff pumping is shown again (it never stopped with the page) Co-Authored-By: Claude Opus 5.5 --- app/web/src/pages/Stations.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/web/src/pages/Stations.jsx b/app/web/src/pages/Stations.jsx index 093cfd2..cfdee37 100644 --- a/app/web/src/pages/Stations.jsx +++ b/app/web/src/pages/Stations.jsx @@ -13,7 +13,10 @@ const shift = (d, n) => (d ? new Date(Date.parse(d) + n * 864e5).toISOString().s export default function Stations({ selection }) { const [rows, setRows] = useState([]), [checked, setChecked] = useState([]); const [range, setRange] = useState({ start: shift(selection.start, -3), end: selection.end }); - const [images, setImages] = useState(true), [diff, setDiff] = useState(false), [state, setState] = useState(null); + // the choice data/diff kept for the tab: back on the page, the pumping left is shown again (it never stops with the page) + const [images, setImages] = useState(true), [diff, setDiffState] = useState(() => sessionStorage.getItem("pumpDiff") === "1"); + const setDiff = d => { sessionStorage.setItem("pumpDiff", d ? "1" : ""); setDiffState(d); }; + const [state, setState] = useState(null); useEffect(() => { call("/api/tracked").then(l => { if (l) { setRows(l); setChecked(l.map(r => r.serial)); } }); }, []); useEffect(() => { setState(null);