Skip to content

Commit

Permalink
fix: apply autostart if no value
Browse files Browse the repository at this point in the history
Signed-off-by: Martichou <[email protected]>
  • Loading branch information
Martichou committed Mar 2, 2024
1 parent ade8a94 commit 87f49a8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions frontend/src/components/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -497,7 +496,6 @@ export default {
methods: {
setAutostart: async function(autostart: boolean) {
console.log(`setAutostart: ${autostart}`);
if (autostart) {
await enable();
} else {
Expand All @@ -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');
Expand Down

0 comments on commit 87f49a8

Please sign in to comment.