making easy-adapter reactive
This commit is contained in:
@@ -108,7 +108,10 @@ module.exports = new Vue({
|
|||||||
modified: false,
|
modified: false,
|
||||||
template: require("../resources/config-template.json"),
|
template: require("../resources/config-template.json"),
|
||||||
config: {
|
config: {
|
||||||
settings: { units: "METRIC" },
|
settings: {
|
||||||
|
units: "METRIC",
|
||||||
|
"easy-adapter": false
|
||||||
|
},
|
||||||
motors: [{}, {}, {}, {}],
|
motors: [{}, {}, {}, {}],
|
||||||
version: "<loading>",
|
version: "<loading>",
|
||||||
full_version: "<loading>",
|
full_version: "<loading>",
|
||||||
@@ -243,20 +246,10 @@ module.exports = new Vue({
|
|||||||
},
|
},
|
||||||
|
|
||||||
is_easy_adapter_active: function() {
|
is_easy_adapter_active: function() {
|
||||||
// Access the property directly to make it reactive
|
console.log("1", this.config.settings["easy-adapter"]);
|
||||||
// Vue 1 will track this dependency and re-evaluate when the property changes
|
console.log("2", this.config);
|
||||||
if(!this.config.settings) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Explicitly access the easy-adapter property to establish reactivity
|
return this.config.settings["easy-adapter"] === true;
|
||||||
const easyAdapterValue = this.config.settings["easy-adapter"];
|
|
||||||
|
|
||||||
console.log("1",easyAdapterValue);
|
|
||||||
console.log("2",this.config)
|
|
||||||
|
|
||||||
// Return true only if explicitly set to true
|
|
||||||
return easyAdapterValue === true;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
enable_rotary: function() {
|
enable_rotary: function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user