Skip to content

Commit 8f35159

Browse files
vanch3dcaoccao
authored andcommitted
Merge pull request #1007
* fix(33816): reduce the validation slowdown * fix(33816): fix the mutation of updated nodes
1 parent 791f493 commit 8f35159

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

hivemq-edge-frontend/src/extensions/datahub/hooks/useDataHubDraftStore.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ const useDataHubDraftStore = create<WorkspaceState & WorkspaceStatus & Workspace
7777
onUpdateNodes: <T>(item: string, data: T) => {
7878
set({
7979
nodes: get().nodes.map((node) => {
80+
const newNode = { ...node }
8081
if (node.id === item) {
81-
node.data = data
82+
newNode.data = data
8283
}
83-
return node
84+
return newNode
8485
}),
8586
})
8687
},

hivemq-edge-frontend/src/extensions/datahub/utils/datahub.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const SCRIPT_FUNCTION_SEPARATOR = ':'
66
export const SCRIPT_FUNCTION_PREFIX = 'fn'
77
export const SCRIPT_FUNCTION_LATEST = 'latest'
88

9-
export const DRYRUN_VALIDATION_DELAY = 250
9+
export const DRYRUN_VALIDATION_DELAY = 150
1010

1111
export const DATAHUB_HOTKEY = {
1212
COPY: 'Meta+C',

0 commit comments

Comments
 (0)