From f562c54efa0bbb897385b5357f2b303a720d1793 Mon Sep 17 00:00:00 2001 From: Xylight Date: Thu, 5 Sep 2024 17:43:44 -0700 Subject: [PATCH] feat: hide scores if 'show scores' is disabled in profile --- .../components/lemmy/post/PostActions.svelte | 2 + src/lib/components/lemmy/post/PostVote.svelte | 54 ++++++++++--------- src/routes/c/[name]/+layout.ts | 4 -- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/src/lib/components/lemmy/post/PostActions.svelte b/src/lib/components/lemmy/post/PostActions.svelte index 607924fe..9ce25b34 100644 --- a/src/lib/components/lemmy/post/PostActions.svelte +++ b/src/lib/components/lemmy/post/PostActions.svelte @@ -126,6 +126,8 @@ bind:score={post.counts.score} bind:upvotes={post.counts.upvotes} bind:downvotes={post.counts.downvotes} + showCounts={$profile?.user?.local_user_view?.local_user?.show_scores ?? + true} /> {#if $site?.site_view.local_site.enable_downvotes ?? true} {/if} diff --git a/src/routes/c/[name]/+layout.ts b/src/routes/c/[name]/+layout.ts index ec0ddb4e..3df1347f 100644 --- a/src/routes/c/[name]/+layout.ts +++ b/src/routes/c/[name]/+layout.ts @@ -1,9 +1,5 @@ -import { profile } from '$lib/auth.js' import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte' import { getClient } from '$lib/lemmy.js' -import { userSettings } from '$lib/settings.js' -import type { ListingType, SortType } from 'lemmy-js-client' -import { get } from 'svelte/store' export async function load(req: any) { const community = await getClient(undefined, req.fetch).getCommunity({