diff --git a/src/lib/components/lemmy/comment/Comment.svelte b/src/lib/components/lemmy/comment/Comment.svelte index 13a2b2ca..e7ff546a 100644 --- a/src/lib/components/lemmy/comment/Comment.svelte +++ b/src/lib/components/lemmy/comment/Comment.svelte @@ -258,6 +258,7 @@ children: [], comment_view: e.comment_view, depth: node.depth + 1, + expanded: true, }, ...node.children, ] diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index 2ec953b2..d14959d4 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -273,7 +273,8 @@ "emptyComments": { "title": "No comments", "description": "Start the conversation!" - } + }, + "commented": "Your comment was posted." }, "inbox": { "title": "Inbox", diff --git a/src/routes/post/[instance]/[id=integer]/+page.svelte b/src/routes/post/[instance]/[id=integer]/+page.svelte index 7bff45ab..fdcd3dfa 100644 --- a/src/routes/post/[instance]/[id=integer]/+page.svelte +++ b/src/routes/post/[instance]/[id=integer]/+page.svelte @@ -30,7 +30,7 @@ parseTags, } from '$lib/components/lemmy/post/PostMeta.svelte' import { Select, removeToast, toast } from 'mono-svelte' - import type { CommentSortType } from 'lemmy-js-client' + import type { CommentSortType, GetCommentsResponse } from 'lemmy-js-client' import { profile } from '$lib/auth.svelte.js' import { instance } from '$lib/instance.js' import { afterNavigate, goto } from '$app/navigation' @@ -433,8 +433,11 @@ {:else} - (comments.comments = [comment.comment_view, ...comments.comments])} + oncomment={(comment) => { + comments.comments.push(comment.comment_view) + reloadComments() + toast({ content: $t('routes.post.commented'), type: 'success' }) + }} locked={(data.post.post_view.post.locked && !( $profile?.user?.local_user_view.local_user.admin ||