From 87f49a854ae486cbdf9918c387ec95dfc3fade8c Mon Sep 17 00:00:00 2001 From: Martichou Date: Fri, 1 Mar 2024 23:50:01 +0100 Subject: [PATCH] fix: apply autostart if no value Signed-off-by: Martichou --- frontend/src/components/HomePage.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/HomePage.vue b/frontend/src/components/HomePage.vue index 2ed0b7e..8e6c02c 100644 --- a/frontend/src/components/HomePage.vue +++ b/frontend/src/components/HomePage.vue @@ -340,10 +340,9 @@ export default { this.version = await getVersion(); if (!await this.store.has(autostartKey)) { - await enable(); await this.setAutostart(true); } else { - await this.getAutostart(); + await this.applyAutostart(); } // Check permission for notification @@ -497,7 +496,6 @@ export default { methods: { setAutostart: async function(autostart: boolean) { - console.log(`setAutostart: ${autostart}`); if (autostart) { await enable(); } else { @@ -508,9 +506,14 @@ export default { await this.store.save(); this.autostart = autostart; }, - getAutostart: async function() { + applyAutostart: async function() { this.autostart = await this.store.get(autostartKey) ?? false; - return this.autostart; + + if (this.autostart) { + await enable(); + } else { + await disable(); + } }, clearSending: async function() { await invoke('stop_discovery');