diff --git a/src/routes/inbox/+page.svelte b/src/routes/inbox/+page.svelte
index c0f08063..4a74d894 100644
--- a/src/routes/inbox/+page.svelte
+++ b/src/routes/inbox/+page.svelte
@@ -1,14 +1,53 @@
Inbox
-
Inbox
+
+
Inbox
+
+
{#if !data.data || (data.data?.length ?? 0) == 0}
@@ -16,7 +55,7 @@
{:else}
{#each data.data as item}
-
+
{/each}
{/if}
diff --git a/src/routes/inbox/InboxItem.svelte b/src/routes/inbox/InboxItem.svelte
index 1b3788ca..3d2a4a07 100644
--- a/src/routes/inbox/InboxItem.svelte
+++ b/src/routes/inbox/InboxItem.svelte
@@ -2,15 +2,21 @@
import Link from '$lib/components/input/Link.svelte'
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import Card from '$lib/components/ui/Card.svelte'
- import type { CommentReplyView, PersonMentionView } from 'lemmy-js-client'
+ import type {
+ CommentReplyView,
+ PersonMentionView,
+ PrivateMessageView,
+ } from 'lemmy-js-client'
export let item: CommentReplyView | PersonMentionView
+ export let read: boolean
{item.creator.display_name ?? item.creator.name}
diff --git a/src/routes/post/[instance]/[id]/+page.svelte b/src/routes/post/[instance]/[id]/+page.svelte
index 58586da0..1d5e9b72 100644
--- a/src/routes/post/[instance]/[id]/+page.svelte
+++ b/src/routes/post/[instance]/[id]/+page.svelte
@@ -3,13 +3,11 @@
import type { Comment, CommentView } from 'lemmy-js-client'
import type { CommentNodeI } from '$lib/components/lemmy/comment/comments.js'
import Comments from '$lib/components/lemmy/comment/Comments.svelte'
- import SvelteMarkdown from 'svelte-markdown'
import CommunityLink from '$lib/components/community/CommunityLink.svelte'
import { isImage, isVideo } from '$lib/ui/image.js'
- import { user } from '$lib/lemmy.js'
+ import { authData, getClient, user } from '$lib/lemmy.js'
import CommentForm from '$lib/components/lemmy/comment/CommentForm.svelte'
import PostVote from '$lib/components/lemmy/PostVote.svelte'
- import { page } from '$app/stores'
import { onMount } from 'svelte'
import UserLink from '$lib/components/user/UserLink.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte'
@@ -19,6 +17,16 @@
const postData = data.post.post_view
const post = postData.post
+ onMount(async () => {
+ if (!postData.read && $authData) {
+ getClient().markPostAsRead({
+ auth: $authData.token,
+ read: true,
+ post_id: post.id,
+ })
+ }
+ })
+
function getCommentParentId(comment?: Comment): number | undefined {
const split = comment?.path.split('.')
// remove the 0