mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 03:10:08 +08:00
fix(AgentItem): add missing onPress dependency to useCallback
Ensure the callback is updated when onPress prop changes to avoid stale closures
This commit is contained in:
parent
d1819274bb
commit
af6a3c87d6
@ -31,7 +31,7 @@ const AgentItem: FC<AgentItemProps> = ({ agent, isActive, onDelete, onPress }) =
|
||||
<span className="text-sm">{displayName}</span>
|
||||
</Button>
|
||||
)
|
||||
}, [agent.id, agent.name, agent.type])
|
||||
}, [agent.id, agent.name, agent.type, onPress])
|
||||
|
||||
const handleClick = () => logger.debug('not implemented')
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user