fix: correctly set selected step editor code when reverting to snapshot (#6131)

This commit is contained in:
HugoCasa
2025-07-04 13:19:42 +02:00
committed by GitHub
parent 151afe3be3
commit 0cd6bed7f9

View File

@@ -115,6 +115,19 @@
if (snapshot) {
flowStore.val = snapshot
refreshStateStore(flowStore)
if ($currentEditor) {
const module = getModule($currentEditor.stepId, snapshot)
if (module) {
if ($currentEditor.type === 'script' && module.value.type === 'rawscript') {
$currentEditor.editor.setCode(module.value.content)
} else if ($currentEditor.type === 'iterator' && module.value.type === 'forloopflow') {
$currentEditor.editor.setCode(
module.value.iterator.type === 'javascript' ? module.value.iterator.expr : ''
)
}
}
}
}
},
showModuleDiff(id: string) {