Added null propagation operators

This commit is contained in:
Mel O'Hagan 2022-10-13 16:17:47 +01:00
parent bea6e250b8
commit 8a7f6fcd27
1 changed files with 6 additions and 4 deletions

View File

@ -38,17 +38,19 @@
function updateEditorsOnDelete(deleteIndex) {
for (let i = deleteIndex; i < query.fields.steps?.length - 1; i++) {
stepEditors[i].update(query.fields.steps[i + 1].value.value)
stepEditors[i].update(query.fields.steps[i + 1].value?.value)
}
}
function updateEditorsOnSwap(actionIndex, targetIndex) {
const target = query.fields.steps[targetIndex].value.value
stepEditors[targetIndex].update(query.fields.steps[actionIndex].value.value)
const target = query.fields.steps[targetIndex].value?.value
stepEditors[targetIndex].update(
query.fields.steps[actionIndex].value?.value
)
stepEditors[actionIndex].update(target)
}
function setEditorTemplate(fromKey, toKey, index) {
const currentValue = query.fields.steps[index].value.value
const currentValue = query.fields.steps[index].value?.value
if (
!currentValue ||
currentValue.toString().replace("\\s", "").length < 3 ||