fixing edgecase

This commit is contained in:
sanjayk03-dev
2024-12-05 16:07:17 +05:30
parent 5682f25d2b
commit a271360d1c
4 changed files with 12 additions and 7 deletions

View File

@@ -324,13 +324,13 @@ module.exports = new Vue({
showSwitchRotaryModeDialog: function(){
SvelteComponents.showDialog("SwitchRotary", {
isActive: !this.is_rotary_active,
switchMode: () => this.toggle_rotary()
switchMode: (isActive) => this.toggle_rotary(isActive)
});
},
toggle_rotary: async function() {
toggle_rotary: async function(isActive) {
try {
await api.put("rotary");
await api.put("rotary", {status: isActive});
} catch (error) {
console.error(error);
alert("Error occured");