fix: make dedicated $notifications store
This commit is contained in:
1 parent
19d4617dbf
commit
53bf2ebf78
10 files changed
+52
-51
No files matched your search
@@ -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,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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user