fix: race condition tools approval state (#5259)
This commit is contained in:
parent
414a9f0da5
commit
32f68de36f
@ -54,6 +54,13 @@ export const useToolApproval = create<ToolApprovalState>()(
|
||||
|
||||
showApprovalModal: (toolName: string, threadId: string) => {
|
||||
return new Promise<boolean>((resolve) => {
|
||||
// Check if tool is already approved for this thread
|
||||
const state = get()
|
||||
if (state.isToolApproved(threadId, toolName)) {
|
||||
resolve(true)
|
||||
return
|
||||
}
|
||||
|
||||
set({
|
||||
isModalOpen: true,
|
||||
modalProps: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user