fix: remove hide button on piefed
This commit is contained in:
4 files changed
+34
-22
No files matched your search
@@ -4,6 +4,7 @@
|
||||
import { searchParam } from '$lib/util.svelte'
|
||||
import { Select } from 'mono-svelte'
|
||||
import {
|
||||
ChartBar,
|
||||
GlobeAmericas,
|
||||
Icon,
|
||||
MapPin,
|
||||
@@ -14,6 +15,8 @@
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
||||
import type { SelectProps } from 'mono-svelte/forms/select/Select.svelte'
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import { PiefedClient } from '$lib/client/piefed/piefed'
|
||||
|
||||
interface Props extends SelectProps<string> {
|
||||
selected: string
|
||||
@@ -49,6 +52,11 @@
|
||||
<Option value="All" icon={GlobeAmericas}>
|
||||
{$t('filter.location.all')}
|
||||
</Option>
|
||||
{#if client() instanceof PiefedClient}
|
||||
<Option value="Popular" icon={ChartBar}>
|
||||
{$t('filter.location.popular')}
|
||||
</Option>
|
||||
{/if}
|
||||
<Option value="Local" icon={MapPin}>{$t('filter.location.local')}</Option>
|
||||
<Option
|
||||
value="Subscribed"
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
} from 'svelte-hero-icons'
|
||||
import { report } from '../../moderation/moderation'
|
||||
import { hidePost } from '../helpers'
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import { PiefedClient } from '$lib/client/piefed/piefed'
|
||||
|
||||
interface Props {
|
||||
post: PostView
|
||||
@@ -162,26 +164,28 @@
|
||||
</MenuButton>
|
||||
{/if}
|
||||
{#if profile.current.user?.local_user_view.person.id != post.creator.id}
|
||||
<MenuButton
|
||||
onclick={async () => {
|
||||
if (!profile.current?.jwt) return
|
||||
const hidden = await hidePost(
|
||||
post.post.id,
|
||||
!post.hidden,
|
||||
profile.current?.jwt,
|
||||
)
|
||||
post.hidden = hidden
|
||||
if (hidden) onhide?.(hidden)
|
||||
}}
|
||||
color="danger-subtle"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={XMark} size="16" micro />
|
||||
{/snippet}
|
||||
{post.hidden
|
||||
? $t('post.actions.more.unhide')
|
||||
: $t('post.actions.more.hide')}
|
||||
</MenuButton>
|
||||
{#if !(client() instanceof PiefedClient)}
|
||||
<MenuButton
|
||||
onclick={async () => {
|
||||
if (!profile.current?.jwt) return
|
||||
const hidden = await hidePost(
|
||||
post.post.id,
|
||||
!post.hidden,
|
||||
profile.current?.jwt,
|
||||
)
|
||||
post.hidden = hidden
|
||||
if (hidden) onhide?.(hidden)
|
||||
}}
|
||||
color="danger-subtle"
|
||||
>
|
||||
{#snippet prefix()}
|
||||
<Icon src={XMark} size="16" micro />
|
||||
{/snippet}
|
||||
{post.hidden
|
||||
? $t('post.actions.more.unhide')
|
||||
: $t('post.actions.more.hide')}
|
||||
</MenuButton>
|
||||
{/if}
|
||||
<MenuButton onclick={() => report(post)} color="danger-subtle">
|
||||
{#snippet prefix()}
|
||||
<Icon src={Flag} size="16" micro />
|
||||
|
||||
Reference in new issue
Block a user