fix(shell): return to the saved page before the period takes the url

This commit is contained in:
hh committed 2026-10-16 03:53:34 +00:00
1 parent 9e89829bae
commit 189a455308
3 files changed
+9 -8

No files matched your search

+1
View File
@@ -69,6 +69,7 @@ class Period {
const range = rangeFromUrl(url) ?? stored() ?? periodOf(today(), view);
this.start = range.start;
this.end = range.end;
localStorage.setItem(STORAGE_KEY, JSON.stringify(range));
this.ready = true;
}
+2 -2
View File
@@ -19,11 +19,11 @@
onMount(async () => {
try {
const back = await session.boot();
period.init(session.viewRange, page.url);
period.loadFirst().catch(() => undefined);
if (back) {
await goto(back, { replace: true });
}
period.init(session.viewRange, page.url);
period.loadFirst().catch(() => undefined);
} catch (error) {
session.failed = error instanceof Error ? error.message : String(error);
}