Ignore actions.enable/disable errors

Can happen when buttons were destroyed.
Unclear if we really need to call this at all, CSS may be enough already.
This commit is contained in:
Alex P 2023-09-11 10:39:35 +03:00
parent 465649ba15
commit a2f61e9505
No known key found for this signature in database
GPG key ID: 54487A734A204D71

View file

@ -165,14 +165,22 @@ class Renderer {
if (!this.buttonsOptions[wrapper]) {
return;
}
this.buttonsOptions[wrapper].actions.disable();
try {
this.buttonsOptions[wrapper].actions.disable();
} catch (err) {
console.log('Failed to disable buttons: ' + err);
}
}
enableSmartButtons(wrapper) {
if (!this.buttonsOptions[wrapper]) {
return;
}
this.buttonsOptions[wrapper].actions.enable();
try {
this.buttonsOptions[wrapper].actions.enable();
} catch (err) {
console.log('Failed to enable buttons: ' + err);
}
}
}