windows95/src/renderer/utils/get-state-path.ts

14 lines
327 B
TypeScript
Raw Normal View History

2021-01-04 18:54:20 +01:00
import { ipcRenderer } from "electron";
import { IPC_COMMANDS } from "../../constants";
2020-12-14 01:14:18 +01:00
2021-01-04 18:54:20 +01:00
let _statePath = "";
2020-12-14 01:14:18 +01:00
export async function getStatePath(): Promise<string> {
if (_statePath) {
return _statePath;
}
const statePath = await ipcRenderer.invoke(IPC_COMMANDS.GET_STATE_PATH);
2021-01-04 18:54:20 +01:00
return (_statePath = statePath);
2020-12-14 01:14:18 +01:00
}