From dca0edf0b1d25fa639e1b4eab47b2f1298fe81af Mon Sep 17 00:00:00 2001 From: Xyphyn Date: Sat, 12 Aug 2023 10:09:19 -0700 Subject: [PATCH] misc: use bindings to show updated data easily --- .../components/lemmy/comment/Comment.svelte | 2 +- .../lemmy/comment/CommentActions.svelte | 2 +- .../components/lemmy/comment/Comments.svelte | 2 +- src/lib/components/lemmy/post/Post.svelte | 7 +- .../components/lemmy/post/PostActions.svelte | 8 +- src/lib/settings.ts | 2 + .../post/[instance]/[id=integer]/+page.svelte | 91 +++++++++---------- src/routes/settings/+page.svelte | 7 ++ 8 files changed, 63 insertions(+), 58 deletions(-) diff --git a/src/lib/components/lemmy/comment/Comment.svelte b/src/lib/components/lemmy/comment/Comment.svelte index 96343c98..4a39c875 100644 --- a/src/lib/components/lemmy/comment/Comment.svelte +++ b/src/lib/components/lemmy/comment/Comment.svelte @@ -153,7 +153,7 @@ {#if actions}
(editing = true)} /> diff --git a/src/lib/components/lemmy/comment/CommentActions.svelte b/src/lib/components/lemmy/comment/CommentActions.svelte index e3a45b6d..784122c7 100644 --- a/src/lib/components/lemmy/comment/CommentActions.svelte +++ b/src/lib/components/lemmy/comment/CommentActions.svelte @@ -78,7 +78,7 @@ Reply {#if $profile?.user && (amMod($profile?.user, comment.community) || isAdmin($profile.user))} - + {/if} {#if node.children?.length > 0} - + {/if} {#if node.comment_view.counts.child_count > 0 && node.children.length == 0}
(loaded = true)} /> @@ -129,11 +129,8 @@ {/if} {#if actions} { - post.post.name = e.detail.post.name - post.post.body = e.detail.post.body - post.post.url = e.detail.post.url toast({ content: 'The post was edited successfully.', type: 'success', diff --git a/src/lib/components/lemmy/post/PostActions.svelte b/src/lib/components/lemmy/post/PostActions.svelte index 83abbc10..ad72c456 100644 --- a/src/lib/components/lemmy/post/PostActions.svelte +++ b/src/lib/components/lemmy/post/PostActions.svelte @@ -59,7 +59,7 @@ } async function save(post: PostView) { - if (!$profile?.jwt) return + if (!$profile?.jwt) return false const saved = post.saved @@ -79,6 +79,8 @@ type: 'error', }) } + + return post.saved } const dispatcher = createEventDispatcher<{ edit: PostView }>() @@ -119,7 +121,7 @@
{#if $profile?.user && (amMod($profile.user, post.community) || isAdmin($profile.user))} - + {/if}
Comments - {postData.counts.comments} + {data.post.post_view.counts.comments}
(comments.comments = [ comment.detail.comment_view, ...comments.comments, ])} - locked={postData.post.locked} + locked={data.post.post_view.post.locked} /> {/if} {#await buildCommentsTreeAsync(comments.comments)} @@ -186,7 +179,11 @@
{:then comments} - + {/await} {:catch}
diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte index ce50e28c..d668c9b0 100644 --- a/src/routes/settings/+page.svelte +++ b/src/routes/settings/+page.svelte @@ -101,6 +101,13 @@ bind:selected={$userSettings.showCompactPosts} /> + + + NSFW blur + + Blur images of NSFW content. + + Instances Show instances