More fixes to state management for feeds / searches

This commit is contained in:
WardPearce
2025-06-01 22:09:01 +12:00
parent 5e8f15aff0
commit 281d3cef80
3 changed files with 12 additions and 5 deletions
+9 -2
View File
@@ -173,7 +173,10 @@
<header></header>
{#each getPages() as navPage}
{#if !navPage.requiresAuth || isLoggedIn}
<a href={navPage.href} class:active={$page.url.href.endsWith(navPage.href)}
<a
href={navPage.href}
class:active={$page.url.href.endsWith(navPage.href)}
data-sveltekit-preload-data="off"
><i>{navPage.icon}</i>
<div>{navPage.name}</div>
</a>
@@ -256,7 +259,11 @@
<nav class="bottom s">
{#each getPages() as navPage}
{#if !navPage.requiresAuth || isLoggedIn}
<a class="round" href={navPage.href} class:active={$page.url.href.endsWith(navPage.href)}
<a
class="round"
href={navPage.href}
class:active={$page.url.href.endsWith(navPage.href)}
data-sveltekit-preload-data="off"
><i>{navPage.icon}</i>
{#if $page.url.href.endsWith(navPage.href)}
<span style="font-size: .8em;">{navPage.name}</span>
@@ -24,7 +24,7 @@ export async function load({ params, url }) {
} else {
getSearch(params.slug, { type: type }).then((newSearch) => {
searchCacheStore.set({
[type]: [...newSearch, ...search]
[type]: [...new Set([...newSearch, ...search])]
});
});
}
@@ -19,9 +19,9 @@ export async function load() {
feedCacheStore.set({ subscription: videos });
} else {
await getFeed(100, 1).then((feeds) => {
const newVideos = [...feeds.notifications, ...feeds.videos];
const newVideos = [...feeds.notifications, ...feeds.videos, ...videos];
feedCacheStore.set({
subscription: [...newVideos, ...videos]
subscription: [...new Set(newVideos)]
});
});
}