mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-09 06:49:02 +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>
|
<span className="text-sm">{displayName}</span>
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}, [agent.id, agent.name, agent.type])
|
}, [agent.id, agent.name, agent.type, onPress])
|
||||||
|
|
||||||
const handleClick = () => logger.debug('not implemented')
|
const handleClick = () => logger.debug('not implemented')
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user