fix(structuredclone): change

This commit is contained in:
2026-02-28 16:54:50 +08:00
parent 717b7237a2
commit cc9bea54e5
12 changed files with 101 additions and 103 deletions

View File

@@ -51,6 +51,7 @@ import { useRightToolsStore } from "./useRightToolsStore"
import { useIntervalStore, useTimerStore } from "./useTimerStore"
import { useTopToolsStore } from "./useTopToolsStore"
import { findGroupKey } from "./util"
import { safeClone } from "./utils/clone"
import { labelTypeMap } from "./utils/constants"
// Splitter component - will need custom implementation or alternative
@@ -662,19 +663,19 @@ const LabelPage = ({
if (JSON.stringify(current_data) === "{}") {
current_data = qaData.get("init")
}
const qaMap = structuredClone(qaData)
const qaMap = safeClone(qaData)
qaMap.set(key, current_data)
useDescToolsStore.getState().setQaData(qaMap)
}
} else if (useDescToolsStore.getState().descOperations.length) {
if (desc) {
const { meta_operation, other_desc } = desc
const currentMetaMap = structuredClone(
const currentMetaMap = safeClone(
useDescToolsStore.getState().metaData
)
currentMetaMap.set(key, meta_operation || [])
useDescToolsStore.getState().setMetaData(currentMetaMap)
const currentDescMap = structuredClone(
const currentDescMap = safeClone(
useDescToolsStore.getState().descData
)
let descMap = new Map()
@@ -1084,7 +1085,7 @@ const LabelPage = ({
// }
// }
// 更新当前数据
useLabelStore.getState().setLabel(structuredClone(data))
useLabelStore.getState().setLabel(safeClone(data))
}
}