File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
src/components/widgets/macros Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -140,19 +140,36 @@ export default class MacroBtn extends Mixins(StateMixin) {
140140 return ' '
141141 }
142142
143+ get klippyApp () {
144+ return this .$store .getters [' printer/getKlippyApp' ]
145+ }
146+
147+ get supportsPythonGcodeMacros () {
148+ return [' danger-klipper' , ' kalico' ].includes (this .klippyApp .name )
149+ }
150+
143151 handleClick () {
144152 this .$emit (' click' , this .macroName )
145153 }
146154
147155 mounted () {
148- if (! this .macro .config || ! this .macro .config .gcode ) return
156+ const gcode = this .macro .config ?.gcode
157+
158+ if (! gcode ) return
149159
150160 const paramNameForRawGcodeCommand = this .paramNameForRawGcodeCommand
151161
152162 if (paramNameForRawGcodeCommand ) {
153163 this .$set (this .params , paramNameForRawGcodeCommand , { value: ' ' , reset: ' ' })
154164 } else {
155- for (const { name, value } of gcodeMacroParams (this .macro .config .gcode )) {
165+ if (
166+ this .supportsPythonGcodeMacros &&
167+ / ^ \s * !/ .test (gcode )
168+ ) {
169+ return
170+ }
171+
172+ for (const { name, value } of gcodeMacroParams (gcode )) {
156173 if (! name .startsWith (' _' ) && ! this .params [name ]) {
157174 this .$set (this .params , name , { value , reset: value })
158175 }
You can’t perform that action at this time.
0 commit comments