fix: fix macro parameter with spaces (#1551)

This commit is contained in:
Stefan Dej 2023-09-14 18:35:31 +02:00 committed by GitHub
parent ecaa894fbb
commit c87586aebb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -199,9 +199,13 @@ export default class MacroButton extends Mixins(BaseMixin) {
sendWithParams() {
let params: string[] = []
this.paramArray.forEach((paramname: string) => {
if (this.params[paramname].value !== null && this.params[paramname].value !== '') {
let value = this.params[paramname].value?.toString().trim()
if (this.params[paramname].value !== null && value !== '') {
let tmp: string = paramname
tmp += this.isGcodeStyle ? this.params[paramname].value : `=${this.params[paramname].value}`
if (value?.includes(' ')) value = `"${value}"`
tmp += this.isGcodeStyle ? value : `=${value}`
params.push(tmp)
}