Fix: Metadata tips info (#12209)

### What problem does this PR solve?

Fix: Metadata tips info

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2025-12-25 15:55:06 +08:00
committed by GitHub
parent f6217bb990
commit 2817be14d5
10 changed files with 76 additions and 25 deletions

View File

@ -3,6 +3,7 @@
import message from '@/components/ui/message';
import { useSetModalState } from '@/hooks/common-hooks';
import { useHandleSearchChange } from '@/hooks/logic-hooks';
import { useFetchTenantInfo } from '@/hooks/use-user-setting-request';
import memoryService, { updateMemoryById } from '@/services/memory-service';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { useDebounce } from 'ahooks';
@ -216,15 +217,22 @@ export const useRenameMemory = () => {
const { updateMemory } = useUpdateMemory();
const { createMemory } = useCreateMemory();
const [loading, setLoading] = useState(false);
const { data: tenantInfo } = useFetchTenantInfo();
const handleShowChatRenameModal = useCallback(
(record?: IMemory) => {
if (record) {
setMemory(record);
const embd_id = record.embd_id || tenantInfo?.embd_id;
const llm_id = record.llm_id || tenantInfo?.llm_id;
setMemory({
...record,
embd_id,
llm_id,
});
}
showChatRenameModal();
},
[showChatRenameModal],
[showChatRenameModal, tenantInfo],
);
const handleHideModal = useCallback(() => {