mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-14 04:20:07 +02:00
Add local settings
This commit is contained in:
@@ -1 +1,16 @@
|
||||
import isElectron from 'is-electron';
|
||||
|
||||
export * from './hooks/useDefaultSettings';
|
||||
|
||||
const ipc = isElectron() ? window.electron.ipcRenderer : null;
|
||||
|
||||
const get = (property: string) => ipc?.SETTINGS_GET({ property });
|
||||
|
||||
const set = (property: string, value: any) => {
|
||||
ipc?.SETTINGS_SET({ property, value });
|
||||
};
|
||||
|
||||
export const settings = {
|
||||
get,
|
||||
set,
|
||||
};
|
||||
|
||||
Vendored
+2
@@ -33,6 +33,8 @@ declare global {
|
||||
RENDERER_PLAYER_STOP(
|
||||
cb: (event: IpcRendererEvent, data: any) => void
|
||||
): void;
|
||||
SETTINGS_GET(data: { property: string }): any;
|
||||
SETTINGS_SET(data: { property: string; value: any }): void;
|
||||
windowClose(): void;
|
||||
windowMaximize(): void;
|
||||
windowMinimize(): void;
|
||||
|
||||
Reference in New Issue
Block a user