mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: Fixed the issue where the drop-down box could not be displayed after selecting a large model #9869 (#10205)
### What problem does this PR solve? Fix: Fixed the issue where the drop-down box could not be displayed after selecting a large model #9869 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -1,12 +1,14 @@
|
||||
import { useSendMessageBySSE } from '@/hooks/use-send-message';
|
||||
import api from '@/utils/api';
|
||||
import { useCallback } from 'react';
|
||||
import { get } from 'lodash';
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useParams } from 'umi';
|
||||
import { useSaveGraphBeforeOpeningDebugDrawer } from './use-save-graph';
|
||||
|
||||
export function useRunDataflow(showLogSheet: () => void) {
|
||||
const { send } = useSendMessageBySSE(api.runCanvas);
|
||||
const { id } = useParams();
|
||||
const [messageId, setMessageId] = useState();
|
||||
|
||||
const { handleRun: saveGraph, loading } =
|
||||
useSaveGraphBeforeOpeningDebugDrawer(showLogSheet!);
|
||||
@ -22,12 +24,21 @@ export function useRunDataflow(showLogSheet: () => void) {
|
||||
files: [fileResponseData.file],
|
||||
});
|
||||
|
||||
if (res && res?.response.status === 200 && res?.data?.code === 0) {
|
||||
if (res && res?.response.status === 200 && get(res, 'data.code') === 0) {
|
||||
// fetch canvas
|
||||
|
||||
const msgId = get(res, 'data.data.message_id');
|
||||
if (msgId) {
|
||||
setMessageId(msgId);
|
||||
}
|
||||
|
||||
return msgId;
|
||||
}
|
||||
},
|
||||
[id, saveGraph, send],
|
||||
);
|
||||
|
||||
return { run, loading: loading };
|
||||
return { run, loading: loading, messageId };
|
||||
}
|
||||
|
||||
export type RunDataflowType = ReturnType<typeof useRunDataflow>;
|
||||
|
||||
Reference in New Issue
Block a user