mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-21 13:14:04 +02:00
feat: add autostart toggle setting
This commit is contained in:
parent
6d7874c1ae
commit
3bfd72b638
7 changed files with 11 additions and 16 deletions
9
app.vue
9
app.vue
|
@ -7,9 +7,11 @@
|
|||
<script setup lang="ts">
|
||||
import { listen } from "@tauri-apps/api/event";
|
||||
import { app, window } from "@tauri-apps/api";
|
||||
import { disable, enable } from "@tauri-apps/plugin-autostart";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
const keyboard = useKeyboard();
|
||||
const { $settings } = useNuxtApp();
|
||||
|
||||
onMounted(async () => {
|
||||
await listen("settings", async () => {
|
||||
|
@ -19,6 +21,12 @@ onMounted(async () => {
|
|||
await window.getCurrentWindow().show();
|
||||
});
|
||||
|
||||
if ((await $settings.getSetting("autostart")) === "true") {
|
||||
await enable();
|
||||
} else {
|
||||
await disable();
|
||||
}
|
||||
|
||||
await listen("main_route", async () => {
|
||||
await navigateTo("/");
|
||||
});
|
||||
|
@ -54,7 +62,6 @@ onMounted(async () => {
|
|||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
color: #e5dfd5;
|
||||
text-decoration: none;
|
||||
font-family: SFRoundedRegular;
|
||||
scroll-behavior: smooth;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue