fix: make dedicated $notifications store

This commit is contained in:
Xylight committed 2024-07-06 11:33:31 -07:00
1 parent 19d4617dbf
commit 53bf2ebf78
10 files changed
+52 -51

No files matched your search

+2 -2
View File
@@ -13,7 +13,7 @@
import { goto } from '$app/navigation'
import { page } from '$app/stores'
import Pageination from '$lib/components/ui/Pageination.svelte'
import { profile } from '$lib/auth.js'
import { notifications, profile } from '$lib/auth.js'
import Placeholder from '$lib/components/ui/Placeholder.svelte'
import { fly } from 'svelte/transition'
import { searchParam } from '$lib/util.js'
@@ -36,7 +36,7 @@
const response = await getClient().markAllAsRead()
$profile.user.notifications.inbox = 0
$notifications.inbox = 0
goto($page.url, {
invalidateAll: true,
+2 -2
View File
@@ -2,7 +2,7 @@
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
import { getClient } from '$lib/lemmy.js'
import { profile } from '$lib/auth.js'
import { notifications, profile } from '$lib/auth.js'
import {
ArrowUturnLeft,
ArrowUturnUp,
@@ -58,7 +58,7 @@
}
item.read = isRead
if ($profile.user) $profile.user.notifications.inbox += isRead ? -1 : 1
if ($profile.user) $notifications.inbox += isRead ? -1 : 1
loading = false
}