From 11164a440dad8c2dafaad40420be49a757e754d2 Mon Sep 17 00:00:00 2001 From: Mary Date: Tue, 12 Dec 2023 16:49:14 +0700 Subject: [PATCH] fix: don't show temp mutes on signed-in accounts --- .../components/dialogs/MuteConfirmDialog.tsx | 47 ++++++++++++------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/app/com/components/dialogs/MuteConfirmDialog.tsx b/app/com/components/dialogs/MuteConfirmDialog.tsx index a1685b7a..b7f9bb16 100644 --- a/app/com/components/dialogs/MuteConfirmDialog.tsx +++ b/app/com/components/dialogs/MuteConfirmDialog.tsx @@ -1,9 +1,10 @@ -import { type JSX, createSignal } from 'solid-js'; +import { type JSX, createSignal, createMemo } from 'solid-js'; import { type InfiniteData, useQueryClient } from '@pkg/solid-query'; import type { RefOf } from '~/api/atp-schema.ts'; import { ListPurposeLabels } from '~/api/display.ts'; +import { multiagent } from '~/api/globals/agent.ts'; import type { FilterPreferences } from '~/api/types.ts'; import { updateProfileMute } from '~/api/mutations/mute-profile.ts'; @@ -95,6 +96,10 @@ const renderMuteConfirmDialog = (profile: SignalizedProfile, filters: FilterPref const [duration, setDuration] = createSignal('-1'); + const isAccount = createMemo(() => { + return multiagent.accounts.some((account) => account.did === profile.did); + }); + const handleConfirm = () => { const uid = profile.uid; const did = profile.did; @@ -165,23 +170,29 @@ const renderMuteConfirmDialog = (profile: SignalizedProfile, filters: FilterPref your posts and follow you.

- + {(() => { + if (!isAccount()) { + return ( + + ); + } + })()} {duration() !== '-1' ? (