diff --git a/README.md b/README.md index 8d15476afbf1..520ffc8bdc31 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,6 @@ FastGPT 是一个基于 LLM 大语言模型的知识库问答系统,提供开 project - - license -

https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409bd33f6d4 diff --git a/packages/web/hooks/useI18n.ts b/packages/web/hooks/useI18n.ts index bbe049d2caee..0f252349f89a 100644 --- a/packages/web/hooks/useI18n.ts +++ b/packages/web/hooks/useI18n.ts @@ -32,9 +32,10 @@ export const useI18nLng = () => { }); const currentLng = i18n?.language; - await i18n?.changeLanguage?.(lang); + if (!currentLng) return; - if (currentLng !== lang && currentLng) { + await i18n?.changeLanguage?.(lang); + if (currentLng !== lang) { window?.location?.reload?.(); } }; diff --git a/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/hooks/useWorkflow.tsx b/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/hooks/useWorkflow.tsx index 383191d25b93..b99a1ce70dcf 100644 --- a/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/hooks/useWorkflow.tsx +++ b/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/hooks/useWorkflow.tsx @@ -672,7 +672,7 @@ export const useWorkflow = () => { export const useLoopNode = () => { const nodes = useContextSelector(WorkflowInitContext, (state) => state.nodes); const onNodesChange = useContextSelector(WorkflowNodeEdgeContext, (state) => state.onNodesChange); - const { onChangeNode } = useContextSelector(WorkflowContext, (v) => v); + const onChangeNode = useContextSelector(WorkflowContext, (v) => v.onChangeNode); const resetParentNodeSizeAndPosition = useMemoizedFn((parentId: string) => { const { childNodes, loopNode } = nodes.reduce( diff --git a/projects/app/src/pages/app/detail/components/WorkflowComponents/context/index.tsx b/projects/app/src/pages/app/detail/components/WorkflowComponents/context/index.tsx index 72e9acb14878..f2fe96350c64 100644 --- a/projects/app/src/pages/app/detail/components/WorkflowComponents/context/index.tsx +++ b/projects/app/src/pages/app/detail/components/WorkflowComponents/context/index.tsx @@ -831,7 +831,7 @@ const WorkflowContextProvider = ({ const undo = useMemoizedFn(() => { if (past.length > 1) { forbiddenSaveSnapshot.current = true; - + // Current version is the first one, so we need to reset the second one const firstPast = past[1]; resetSnapshot(firstPast); diff --git a/projects/app/src/web/core/workflow/utils.ts b/projects/app/src/web/core/workflow/utils.ts index fa9f68fc0e56..19841d274a89 100644 --- a/projects/app/src/web/core/workflow/utils.ts +++ b/projects/app/src/web/core/workflow/utils.ts @@ -634,7 +634,7 @@ export const compareSnapshot = ( selectedTypeIndex: input.selectedTypeIndex ?? 0, renderTypeLis: input.renderTypeList, // set to arrayAny for loopInputArray to skip valueType comparison - valueType: input.key === NodeInputKeyEnum.loopInputArray ? 'arrayAny' : input.valueType, + // valueType: input.key === NodeInputKeyEnum.loopInputArray ? 'arrayAny' : input.valueType, value: input.value ?? undefined })), outputs: node.data.outputs.map((item: FlowNodeOutputItemType) => ({