Feat: Displays the loading status of the data flow log #9869 (#10347)

### What problem does this PR solve?

Feat: Displays the loading status of the data flow log #9869

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-09-28 19:38:46 +08:00
committed by GitHub
parent f4cc4dbd30
commit 664bc0b961
9 changed files with 121 additions and 56 deletions

View File

@ -3,19 +3,19 @@ import { useCallback } from 'react';
export function useCancelCurrentDataflow({
messageId,
setMessageId,
stopFetchTrace,
}: {
messageId: string;
setMessageId: (messageId: string) => void;
stopFetchTrace(): void;
}) {
const { cancelDataflow } = useCancelDataflow();
const handleCancel = useCallback(async () => {
const code = await cancelDataflow(messageId);
if (code === 0) {
setMessageId('');
stopFetchTrace();
}
}, [cancelDataflow, messageId, setMessageId]);
}, [cancelDataflow, messageId, stopFetchTrace]);
return { handleCancel };
}