feat: removed usage of structuredClone inside the editorWarningSystem
ref: N25B-450
This commit is contained in:
@@ -138,9 +138,8 @@ export function editorWarningRegistry(get: ZustandGet, set: ZustandSet) : Editor
|
||||
const { scope: {id, handleId}, type, severity } = warning;
|
||||
const warningKey = handleId ? `${type}:${handleId}` : type;
|
||||
const compositeKey = `${id}|${warningKey}`;
|
||||
const wRegistry = structuredClone(get().editorWarningRegistry);
|
||||
const sIndex = structuredClone(get().severityIndex);
|
||||
console.log("register")
|
||||
const wRegistry = get().editorWarningRegistry;
|
||||
const sIndex = get().severityIndex;
|
||||
// add to warning registry
|
||||
if (!wRegistry.has(id)) {
|
||||
wRegistry.set(id, new Map());
|
||||
@@ -160,9 +159,8 @@ export function editorWarningRegistry(get: ZustandGet, set: ZustandSet) : Editor
|
||||
},
|
||||
|
||||
unregisterWarning: (id, warningKey) => {
|
||||
const wRegistry = structuredClone(get().editorWarningRegistry);
|
||||
const sIndex = structuredClone(get().severityIndex);
|
||||
console.log("unregister")
|
||||
const wRegistry = get().editorWarningRegistry;
|
||||
const sIndex = get().severityIndex;
|
||||
// verify if the warning was created already
|
||||
const warning = wRegistry.get(id)?.get(warningKey);
|
||||
if (!warning) return;
|
||||
@@ -181,8 +179,8 @@ export function editorWarningRegistry(get: ZustandGet, set: ZustandSet) : Editor
|
||||
},
|
||||
|
||||
unregisterWarningsForId: (id) => {
|
||||
const wRegistry = structuredClone(get().editorWarningRegistry);
|
||||
const sIndex = structuredClone(get().severityIndex);
|
||||
const wRegistry = get().editorWarningRegistry;
|
||||
const sIndex = get().severityIndex;
|
||||
|
||||
const nodeWarnings = wRegistry.get(id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user