Fix delete message error (#4065)

zio/stable
Eric Bailey 2024-05-16 19:08:04 -05:00 committed by GitHub
parent d424945eed
commit eb1428b1d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 14 deletions

View File

@ -34,7 +34,6 @@ export let MessageMenu = ({
const {currentAccount} = useSession()
const convo = useConvoActive()
const deleteControl = usePromptControl()
const retryDeleteControl = usePromptControl()
const reportControl = usePromptControl()
const isFromSelf = message.sender?.did === currentAccount?.did
@ -57,8 +56,8 @@ export let MessageMenu = ({
convo
.deleteMessage(message.id)
.then(() => Toast.show(_(msg`Message deleted`)))
.catch(() => retryDeleteControl.open())
}, [_, convo, message.id, retryDeleteControl])
.catch(() => Toast.show(_(msg`Failed to delete message`)))
}, [_, convo, message.id])
return (
<>
@ -125,17 +124,6 @@ export let MessageMenu = ({
confirmButtonColor="negative"
onConfirm={onDelete}
/>
<Prompt.Basic
control={retryDeleteControl}
title={_(msg`Failed to delete message`)}
description={_(
msg`An error occurred while trying to delete the message. Please try again.`,
)}
confirmButtonCta={_(msg`Retry`)}
confirmButtonColor="negative"
onConfirm={onDelete}
/>
</>
)
}