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.
This commit is contained in:
lemon
2026-06-23 12:22:27 -07:00
parent cf9535ff39
commit 05c1d1bf39
+6 -2
View File
@@ -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 }),