Index: sources/gui/qml/pages/pretreatment/PreTreatmentBase.qml =================================================================== diff -u -r1286d74bd015276aab604808be2766136091c125 -rf90366dd7a36ac03a4e387550811fe5b8a7fbe80 --- sources/gui/qml/pages/pretreatment/PreTreatmentBase.qml (.../PreTreatmentBase.qml) (revision 1286d74bd015276aab604808be2766136091c125) +++ sources/gui/qml/pages/pretreatment/PreTreatmentBase.qml (.../PreTreatmentBase.qml) (revision f90366dd7a36ac03a4e387550811fe5b8a7fbe80) @@ -30,21 +30,18 @@ header.visible : false headerTitle : qsTr("Setup Treatment") - onVisibleChanged: if ( visible ) { _root.updateModel() } + onVisibleChanged: if ( visible && instructionBased ) { _root.updateModel() } // update model for instruction based steps function updateModel () { - let stepName = stepNames[stackStepIndex] - if ( stepName === undefined ) stepName = "" + let stepName = stepNames[stackStepIndex] ?? "" + let group = vSettings.groupFormat(stepName, vSettings.advancedMode || _root.subStepName.length === 0 ? "" : _root.subStepName ) + let instructionsGroup = vSettings.instructions[group] - let group = vSettings.groupFormat(stepName, vSettings.advancedMode || _root.subStepName.length === 0 ? "" : _root.subStepName ) + if ( ! instructionsGroup ) { return } - let instructionsGroup = vSettings.instructions[group] - - if ( instructionsGroup !== undefined ) { - instructionTitle = instructionsGroup.title - instructionStepNames = instructionsGroup.keys - instructionStepImages = instructionsGroup.values - } + instructionTitle = instructionsGroup.title + instructionStepNames = instructionsGroup.keys + instructionStepImages = instructionsGroup.values } }