|
1 | 1 | import { app } from "electron" |
2 | 2 | import { DEFAULT_SERVER_URL_KEY, WSL_ENABLED_KEY } from "./constants" |
3 | 3 | import { getUserShell, loadShellEnv } from "./shell-env" |
4 | | -import { store } from "./store" |
| 4 | +import { getStore } from "./store" |
5 | 5 |
|
6 | 6 | export type WslConfig = { enabled: boolean } |
7 | 7 |
|
8 | 8 | export type HealthCheck = { wait: Promise<void> } |
9 | 9 |
|
10 | 10 | export function getDefaultServerUrl(): string | null { |
11 | | - const value = store.get(DEFAULT_SERVER_URL_KEY) |
| 11 | + const value = getStore().get(DEFAULT_SERVER_URL_KEY) |
12 | 12 | return typeof value === "string" ? value : null |
13 | 13 | } |
14 | 14 |
|
15 | 15 | export function setDefaultServerUrl(url: string | null) { |
16 | 16 | if (url) { |
17 | | - store.set(DEFAULT_SERVER_URL_KEY, url) |
| 17 | + getStore().set(DEFAULT_SERVER_URL_KEY, url) |
18 | 18 | return |
19 | 19 | } |
20 | 20 |
|
21 | | - store.delete(DEFAULT_SERVER_URL_KEY) |
| 21 | + getStore().delete(DEFAULT_SERVER_URL_KEY) |
22 | 22 | } |
23 | 23 |
|
24 | 24 | export function getWslConfig(): WslConfig { |
25 | | - const value = store.get(WSL_ENABLED_KEY) |
| 25 | + const value = getStore().get(WSL_ENABLED_KEY) |
26 | 26 | return { enabled: typeof value === "boolean" ? value : false } |
27 | 27 | } |
28 | 28 |
|
29 | 29 | export function setWslConfig(config: WslConfig) { |
30 | | - store.set(WSL_ENABLED_KEY, config.enabled) |
| 30 | + getStore().set(WSL_ENABLED_KEY, config.enabled) |
31 | 31 | } |
32 | 32 |
|
33 | 33 | export async function spawnLocalServer(hostname: string, port: number, password: string) { |
|
0 commit comments