From 59005b4c3a582017bf2408eb20c80a8703385290 Mon Sep 17 00:00:00 2001 From: saifullah-N Date: Thu, 22 Jun 2023 18:26:10 +0530 Subject: [PATCH] Synchronize units on control and settings pages. --- src/js/app.js | 3 ++- src/js/control-view.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/app.js b/src/js/app.js index 8205651..cb2412b 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -417,7 +417,8 @@ module.exports = new Vue({ delete settings.tool["tool-type"]; this.config["selected-tool-settings"][selected_tool] = settings; - + this.display_units = this.config.settings["units"]; + try { await api.put("config/save", this.config); this.modified = false; diff --git a/src/js/control-view.js b/src/js/control-view.js index 57bb471..bd1257d 100644 --- a/src/js/control-view.js +++ b/src/js/control-view.js @@ -91,7 +91,9 @@ module.exports = { return this.$root.display_units; }, set: function(value) { + this.config.settings.units = value; this.$root.display_units = value; + this.$dispatch("config-changed"); } },