Index: sources/gui/qml/pages/pretreatment/PreTreatmentBase.qml =================================================================== diff -u -r1286d74bd015276aab604808be2766136091c125 -rc70815ad2b3beadf61832f2e4d12eb90d476e020 --- sources/gui/qml/pages/pretreatment/PreTreatmentBase.qml (.../PreTreatmentBase.qml) (revision 1286d74bd015276aab604808be2766136091c125) +++ sources/gui/qml/pages/pretreatment/PreTreatmentBase.qml (.../PreTreatmentBase.qml) (revision c70815ad2b3beadf61832f2e4d12eb90d476e020) @@ -26,25 +26,22 @@ * \brief the parent page of the pre-treatment screens */ TreatmentFlowBase { id: _root - objectName: "_PreTreatmentBase" - header.visible : false - headerTitle : qsTr("Setup Treatment") + objectName : "_PreTreatmentBase" + 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 } }