modified web/src/routes/articles/+page.svelte +4 -6
| @@ -49,15 +49,13 @@ |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | function markAllRead() { |
| 52 | | - endpoints |
| 53 | | - .markAllRead(feedURL) |
| 54 | | - .then(() => goto("/articles", { invalidateAll: true })); |
| 52 | + endpoints.markAllRead(feedURL).then(() => invalidateAll()); |
| 55 | 53 | } |
| 56 | 54 | |
| 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. |
| 59 | 57 | function onrefresh() { |
| 60 | | - return goto(buildURL({}), { invalidateAll: true, noScroll: false }); |
| 58 | + return invalidateAll(); |
| 61 | 59 | } |
| 62 | 60 | |
| 63 | 61 | // Expanded view: mark articles read on scroll. |
| @@ -49,15 +49,13 @@ |
| 49 | } | 49 | } |
| 50 | | 50 | |
| 51 | function markAllRead() { | 51 | function markAllRead() { |
| 52 | - endpoints | 52 | + 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 articles | 55 | + // 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 @@ |
| 7 | 7 | import EmptyState from "$lib/components/EmptyState.svelte"; |
| 8 | 8 | import Icon from "$lib/components/Icon.svelte"; |
| 9 | 9 | import NewArticlesBanner from "$lib/components/NewArticlesBanner.svelte"; |
| 10 | | - import { goto } from "$app/navigation"; |
| 10 | + import { invalidateAll } from "$app/navigation"; |
| 11 | 11 | import { endpoints } from "$lib/api"; |
| 12 | 12 | import type { |
| 13 | 13 | Article, |
| @@ -67,9 +67,10 @@ |
| 67 | 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 | 72 | function onrefresh() { |
| 72 | | - return goto("/dashboard", { invalidateAll: true }); |
| 73 | + return invalidateAll(); |
| 73 | 74 | } |
| 74 | 75 | |
| 75 | 76 | 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); |