fix(ErrorBlock): prevent event propagation when removing block (#10368)

This PR correctly addresses an event propagation issue where clicking the close button on an error alert was unintentionally triggering the parent click handler (which opens the detail modal).
This commit is contained in:
Phantom 2025-09-28 14:09:11 +08:00 committed by GitHub
parent cd3031479c
commit 5524571c80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -103,7 +103,8 @@ const MessageErrorInfo: React.FC<{ block: ErrorMessageBlock; message: Message }>
const [showDetailModal, setShowDetailModal] = useState(false)
const { t } = useTranslation()
const onRemoveBlock = () => {
const onRemoveBlock = (e: React.MouseEvent) => {
e.stopPropagation()
setTimeoutTimer('onRemoveBlock', () => dispatch(removeBlocksThunk(message.topicId, message.id, [block.id])), 350)
}