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

@@ -47,17 +47,19 @@
let post = data.post
// onMount(async () => {
// if (
// !(post.post_view.read && $userSettings.markPostsAsRead) &&
// $profile?.jwt
// ) {
// getClient().markPostAsRead({
// read: $userSettings.markPostsAsRead,
// post_id: post.post_view.post.id,
// })
// }
// })
onMount(async () => {
if (
!(post.post_view.read && $userSettings.markPostsAsRead) &&
$profile?.jwt
) {
getClient().markPostAsRead({
read: $userSettings.markPostsAsRead,
post_ids: [post.post_view.post.id],
// @ts-ignore
post_id: post.post_view.post.id,
})
}
})
afterNavigate(async () => {
// reactivity hack
@@ -315,7 +317,7 @@ flex-wrap gap-4 sticky top-20 w-full box-border z-20 mt-4"
{/each}
</div>
{:then comments}
{#if $profile?.user}
{#if $profile?.jwt}
<CommentForm
postId={post.post_view.post.id}
on:comment={(comment) =>
@@ -325,7 +327,7 @@ flex-wrap gap-4 sticky top-20 w-full box-border z-20 mt-4"
])}
locked={(post.post_view.post.locked &&
!(
$profile?.user.local_user_view.local_user.admin ||
$profile?.user?.local_user_view.local_user.admin ||
$profile?.user?.moderates
.map((c) => c.community.id)
.includes(data.post.community_view.community.id)