mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-21 05:16:54 +08:00
### 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:
@ -416,13 +416,11 @@ export const useUploadCanvasFileWithProgress = (
|
||||
return { data, loading, uploadCanvasFile: mutateAsync };
|
||||
};
|
||||
|
||||
export const useFetchMessageTrace = (
|
||||
isStopFetchTrace: boolean,
|
||||
canvasId?: string,
|
||||
) => {
|
||||
export const useFetchMessageTrace = (canvasId?: string) => {
|
||||
const { id } = useParams();
|
||||
const queryId = id || canvasId;
|
||||
const [messageId, setMessageId] = useState('');
|
||||
const [isStopFetchTrace, setISStopFetchTrace] = useState(false);
|
||||
|
||||
const {
|
||||
data,
|
||||
@ -442,11 +440,19 @@ export const useFetchMessageTrace = (
|
||||
message_id: messageId,
|
||||
});
|
||||
|
||||
return data?.data ?? [];
|
||||
return Array.isArray(data?.data) ? data?.data : [];
|
||||
},
|
||||
});
|
||||
|
||||
return { data, loading, refetch, setMessageId, messageId };
|
||||
return {
|
||||
data,
|
||||
loading,
|
||||
refetch,
|
||||
setMessageId,
|
||||
messageId,
|
||||
isStopFetchTrace,
|
||||
setISStopFetchTrace,
|
||||
};
|
||||
};
|
||||
|
||||
export const useTestDbConnect = () => {
|
||||
|
||||
Reference in New Issue
Block a user