diff --git a/materialious/src/lib/api/index.ts b/materialious/src/lib/api/index.ts index 149b0292..c0c8e6e2 100644 --- a/materialious/src/lib/api/index.ts +++ b/materialious/src/lib/api/index.ts @@ -254,6 +254,13 @@ export async function getFeed( return await resp.json(); } +export async function notificationsMarkAsRead(fetchOptions: RequestInit = {}) { + if (isYTBackend()) return; + + const path = buildPath('auth/notifications'); + await fetchErrorHandle(await fetch(path, { ...buildAuthHeaders(), ...fetchOptions })); +} + export async function getSubscriptions(fetchOptions: RequestInit = {}): Promise { if (isYTBackend()) { return getSubscriptionsYTjs(); diff --git a/materialious/src/routes/(app)/+layout.svelte b/materialious/src/routes/(app)/+layout.svelte index 3a0ea44c..0c0331bd 100644 --- a/materialious/src/routes/(app)/+layout.svelte +++ b/materialious/src/routes/(app)/+layout.svelte @@ -4,7 +4,7 @@ import { navigating, page } from '$app/stores'; import colorTheme, { convertToHexColorCode } from '$lib/android/plugins/colorTheme'; - import { getFeed } from '$lib/api/index'; + import { getFeed, notificationsMarkAsRead } from '$lib/api/index'; import type { Notification } from '$lib/api/model'; import Logo from '$lib/components/Logo.svelte'; import PageLoading from '$lib/components/PageLoading.svelte'; @@ -184,7 +184,7 @@ } async function loadNotifications() { - const feed = await getFeed(15, 1); + const feed = await getFeed(100, 1); notifications = feed.notifications; } @@ -344,7 +344,12 @@
{$_('layout.syncParty')}
{#if isLoggedIn} -