mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-30 07:39:06 +08:00
fix(SessionItem): prevent event propagation when clicking delete
Stop click event propagation to avoid unintended parent component interactions when deleting a session
This commit is contained in:
parent
bc0f283278
commit
4647688613
@ -59,6 +59,7 @@ const SessionItem: FC<SessionItemProps> = ({ session, agentId, isDisabled, isLoa
|
||||
isConfirmingDeletion ? 'hover:bg-danger-100' : 'hover:bg-foreground-300'
|
||||
)}
|
||||
onClick={(e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
if (isConfirmingDeletion || e.ctrlKey || e.metaKey) {
|
||||
onDelete()
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user