support start on reboot (#132)

* move launcher to eastier lib
* support auto start after reboot
This commit is contained in:
Sijie.Sun
2024-06-04 23:06:10 +08:00
committed by GitHub
parent f9e6264f31
commit 6e77e6b5e7
15 changed files with 281 additions and 118 deletions
+16
View File
@@ -0,0 +1,16 @@
import { setAutoLaunchStatus } from "~/composables/network"
export async function loadAutoLaunchStatusAsync(enable: boolean): Promise<boolean> {
try {
const ret = await setAutoLaunchStatus(enable)
localStorage.setItem('auto_launch', JSON.stringify(ret))
return ret
} catch (e) {
console.error(e)
return false
}
}
export function getAutoLaunchStatusAsync(): boolean {
return localStorage.getItem('auto_launch') === 'true'
}