Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import { ipcMain } from 'electron'; import Store from 'electron-store'; import path from 'path'; export function registerIpcStoreHandlers(userDataPath: string) { const store = new Store({ clearInvalidConfig: true, cwd: userDataPath, }); ipcMain.on('get-user-data-path', e => (e.returnValue = path.join(userDataPath, 'config.json'))); ipcMain.handle('store-set', (_e, { key, value }: any) => store.set(key, value)); ipcMain.handle('store-get', (_e, { key }: any) => store.get(key)); ipcMain.handle('store-delete', (_e, { key }: any) => store.delete(key)); // ipcMain.handle('store-getEntireStore', () => store.store); ipcMain.handle('store-clear', () => store.clear()); ipcMain.on('store-getEntireStore', event => { event.returnValue = store.store; }); } |