From 05c1d1bf3970e73e6e7de61241a2d7fc0f74d69c Mon Sep 17 00:00:00 2001 From: lemon Date: Tue, 23 Jun 2026 12:22:27 -0700 Subject: [PATCH] Hide muted DM conversation immediately on mute handleMute awaited addMute's relay round-trip (fetch fresh kind 10000 + publish) before hiding the conversation, leaving the muted thread visible for a few seconds. Hide the peer optimistically the moment the user confirms; the relay-backed mute list still reconciles on reload. --- src/pages/MessagesPage.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/MessagesPage.tsx b/src/pages/MessagesPage.tsx index 2fa15a6f..935cd135 100644 --- a/src/pages/MessagesPage.tsx +++ b/src/pages/MessagesPage.tsx @@ -290,10 +290,14 @@ function MessageThread({ }; const handleMute = async () => { + // Hide the conversation immediately so the row disappears the moment the + // user confirms — addMute does a relay round-trip (fetch fresh kind 10000 + // + publish) and awaiting that first leaves the muted thread on screen for + // a few seconds. The relay-backed mute list still reconciles on reload. + setMuteConfirmOpen(false); + onMuted(conversation.peer); try { await addMute.mutateAsync({ type: 'pubkey', value: conversation.peer }); - setMuteConfirmOpen(false); - onMuted(conversation.peer); toast({ title: t('messages.mutedToastTitle'), description: t('messages.mutedToastDescription', { name }),