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
@@ -1,16 +1,16 @@
|
||||
<script>
|
||||
import { goto } from '$app/navigation'
|
||||
import { page } from '$app/stores'
|
||||
import { profile } from '$lib/auth'
|
||||
import { notifications, profile } from '$lib/auth'
|
||||
import MultiSelect from '$lib/components/input/Switch.svelte'
|
||||
import { t } from '$lib/translations'
|
||||
import { Badge } from 'mono-svelte'
|
||||
</script>
|
||||
|
||||
{#if ($profile?.user?.notifications.applications ?? 0) > 0}
|
||||
{#if $notifications.applications > 0}
|
||||
<span class="flex flex-row text-red-500 gap-2">
|
||||
<Badge color="red-subtle" class="w-max">
|
||||
{$profile?.user?.notifications.applications}
|
||||
{$notifications.applications}
|
||||
</Badge> unread applications
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { profile } from '$lib/auth.js'
|
||||
import { notifications, profile } from '$lib/auth.js'
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
||||
import { Material, toast } from 'mono-svelte'
|
||||
@@ -60,7 +60,7 @@
|
||||
application.admin = $profile.user!.local_user_view.person
|
||||
application.registration_application.deny_reason = denyReason
|
||||
|
||||
$profile.user!.notifications.applications -= 1
|
||||
$notifications.applications -= 1
|
||||
} catch (err) {
|
||||
toast({
|
||||
content: err as any,
|
||||
|
||||
Reference in new issue
Block a user