Add local settings

This commit is contained in:
jeffvli
2022-10-24 22:38:06 -07:00
parent f09abdb4c6
commit 863dce88b7
6 changed files with 52 additions and 4 deletions
+15
View File
@@ -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,
};
+2
View File
@@ -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;