From 366b1ef29e3da60fdda0faf82ab8e541e7ed10e6 Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Mon, 2 Oct 2023 17:39:53 -0700 Subject: [PATCH] fix: private messages cant be marked as read --- src/routes/inbox/InboxItem.svelte | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/routes/inbox/InboxItem.svelte b/src/routes/inbox/InboxItem.svelte index da123c13..b7f92340 100644 --- a/src/routes/inbox/InboxItem.svelte +++ b/src/routes/inbox/InboxItem.svelte @@ -65,16 +65,27 @@ loading = true - if (item.type == 'person_mention') { - await getClient().markPersonMentionAsRead({ - person_mention_id: item.id, - read: isRead, - }) - } else if (item.type == 'comment_reply') { - await getClient().markCommentReplyAsRead({ - comment_reply_id: item.id, - read: isRead, - }) + switch (item.type) { + case 'person_mention': { + await getClient().markPersonMentionAsRead({ + person_mention_id: item.id, + read: isRead, + }) + break + } + case 'comment_reply': { + await getClient().markCommentReplyAsRead({ + comment_reply_id: item.id, + read: isRead, + }) + break + } + case 'private_message': { + await getClient().markPrivateMessageAsRead({ + private_message_id: item.id, + read: isRead, + }) + } } item.read = isRead