nandi/gleanpublic Fork 0
dea5ae5
Commits
Clone
git clone https://git.rickub.com/nandi/glean.git
git clone ssh://git@rickub.com/nandi/glean.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

fix(web): use invalidateAll for refreshing dataUnverified

Julien Robert committed 2026-07-05T20:44:48+02:00 Browse files
dea5ae5 parent: d8c42c5
modified web/src/routes/articles/+page.svelte +4 -6
@@ -49,15 +49,13 @@
4949 }
5050
5151 function markAllRead() {
52- endpoints
53- .markAllRead(feedURL)
54- .then(() => goto("/articles", { invalidateAll: true }));
52+ endpoints.markAllRead(feedURL).then(() => invalidateAll());
5553 }
5654
57- // Reload the current route (preserving filters) so newly-fetched articles
58- // appear without a manual hard refresh.
55+ // Re-run the route's load function so newly-fetched articles render
56+ // without a navigation or hard refresh.
5957 function onrefresh() {
60- return goto(buildURL({}), { invalidateAll: true, noScroll: false });
58+ return invalidateAll();
6159 }
6260
6361 // Expanded view: mark articles read on scroll.
@@ -49,15 +49,13 @@
49 }49 }
50 50
51 function markAllRead() {51 function markAllRead() {
52- endpoints52+ endpoints.markAllRead(feedURL).then(() => invalidateAll());
53- .markAllRead(feedURL)
54- .then(() => goto("/articles", { invalidateAll: true }));
55 }53 }
56 54
57- // Reload the current route (preserving filters) so newly-fetched articles55+ // Re-run the route's load function so newly-fetched articles render
58- // appear without a manual hard refresh.56+ // without a navigation or hard refresh.
59 function onrefresh() {57 function onrefresh() {
60- return goto(buildURL({}), { invalidateAll: true, noScroll: false });58+ return invalidateAll();
61 }59 }
62 60
63 // Expanded view: mark articles read on scroll.61 // Expanded view: mark articles read on scroll.
modified web/src/routes/dashboard/+page.svelte +4 -3
@@ -7,7 +7,7 @@
77 import EmptyState from "$lib/components/EmptyState.svelte";
88 import Icon from "$lib/components/Icon.svelte";
99 import NewArticlesBanner from "$lib/components/NewArticlesBanner.svelte";
10- import { goto } from "$app/navigation";
10+ import { invalidateAll } from "$app/navigation";
1111 import { endpoints } from "$lib/api";
1212 import type {
1313 Article,
@@ -67,9 +67,10 @@
6767 discover = discover.filter((p) => p.did !== did);
6868 }
6969
70- // Full route reload so newly-fetched articles render without a hard refresh.
70+ // Re-run the route's load function so newly-fetched articles render
71+ // without a navigation or hard refresh.
7172 function onrefresh() {
72- return goto("/dashboard", { invalidateAll: true });
73+ return invalidateAll();
7374 }
7475
7576 let digestOpen = $state(false);
@@ -7,7 +7,7 @@
7 import EmptyState from "$lib/components/EmptyState.svelte";7 import EmptyState from "$lib/components/EmptyState.svelte";
8 import Icon from "$lib/components/Icon.svelte";8 import Icon from "$lib/components/Icon.svelte";
9 import NewArticlesBanner from "$lib/components/NewArticlesBanner.svelte";9 import NewArticlesBanner from "$lib/components/NewArticlesBanner.svelte";
10- import { goto } from "$app/navigation";10+ import { invalidateAll } from "$app/navigation";
11 import { endpoints } from "$lib/api";11 import { endpoints } from "$lib/api";
12 import type {12 import type {
13 Article,13 Article,
@@ -67,9 +67,10 @@
67 discover = discover.filter((p) => p.did !== did);67 discover = discover.filter((p) => p.did !== did);
68 }68 }
69 69
70- // Full route reload so newly-fetched articles render without a hard refresh.70+ // Re-run the route's load function so newly-fetched articles render
71+ // without a navigation or hard refresh.
71 function onrefresh() {72 function onrefresh() {
72- return goto("/dashboard", { invalidateAll: true });73+ return invalidateAll();
73 }74 }
74 75
75 let digestOpen = $state(false);76 let digestOpen = $state(false);