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:
@@ -290,10 +290,14 @@ function MessageThread({
|
||||
};
|
||||
|
||||
const handleMute = async () => {
|
||||
try {
|
||||
await addMute.mutateAsync({ type: 'pubkey', value: conversation.peer });
|
||||
// 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 });
|
||||
toast({
|
||||
title: t('messages.mutedToastTitle'),
|
||||
description: t('messages.mutedToastDescription', { name }),
|
||||
|
||||
Reference in New Issue
Block a user