More fixes to state management for feeds / searches
This commit is contained in:
@@ -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)]
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user