mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-03 02:59:07 +08:00
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:
parent
cd3031479c
commit
5524571c80
@ -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)
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user