Skip to content

Commit

Permalink
perf: snap code (#3350)
Browse files Browse the repository at this point in the history
* perf: readme

* perf: snap code
  • Loading branch information
c121914yu authored Dec 9, 2024
1 parent c64d629 commit 15dc7b2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ FastGPT 是一个基于 LLM 大语言模型的知识库问答系统,提供开
<a href="/#-%E7%9B%B8%E5%85%B3%E9%A1%B9%E7%9B%AE">
<img height="21" src="https://img.shields.io/badge/相关项目-7d09f1?style=flat-square" alt="project">
</a>
<a href="https://github.com/labring/FastGPT/blob/main/LICENSE">
<img height="21" src="https://img.shields.io/badge/License-Apache--2.0-ffffff?style=flat-square&labelColor=d4eaf7&color=7d09f1" alt="license">
</a>
</p>

https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409bd33f6d4
Expand Down
5 changes: 3 additions & 2 deletions packages/web/hooks/useI18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?.();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/web/core/workflow/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => ({
Expand Down

0 comments on commit 15dc7b2

Please sign in to comment.