impr: isolate inbox handling code into separate service class

This commit is contained in:
Xylight authored and xylight committed 2025-11-04 17:56:37 -08:00
1 parent 72bb10b924
commit b8f69dda95
12 files changed
+201 -170

No files matched your search

+3 -2
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import { getClient } from '$lib/api/client.svelte'
import { notifications, profile } from '$lib/app/auth.svelte'
import { profile } from '$lib/app/auth.svelte'
import { t } from '$lib/app/i18n'
import Markdown from '$lib/app/markdown/Markdown.svelte'
import { escapeHtml } from '$lib/app/util.svelte'
@@ -50,7 +50,8 @@
}
item.read = isRead
if (profile.current.user) $notifications.inbox += isRead ? -1 : 1
if (profile.current.user)
profile.inbox.notifications.inbox += isRead ? -1 : 1
loading = false
}