diff options
author | 2021-09-14 11:03:28 +0200 | |
---|---|---|
committer | 2021-09-14 11:03:28 +0200 | |
commit | 087113d8a1214ba4c7df03bfe66747d8d944280c (patch) | |
tree | 4d853a03057138dfa845cd6a7d91ccf63565a1a6 /src/electron/ipc-api/settings.ts | |
parent | chore: codebase improvements (#1930) (diff) | |
download | ferdium-app-087113d8a1214ba4c7df03bfe66747d8d944280c.tar.gz ferdium-app-087113d8a1214ba4c7df03bfe66747d8d944280c.tar.zst ferdium-app-087113d8a1214ba4c7df03bfe66747d8d944280c.zip |
chore: convert JS to TS (#1934)
Diffstat (limited to 'src/electron/ipc-api/settings.ts')
-rw-r--r-- | src/electron/ipc-api/settings.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/electron/ipc-api/settings.ts b/src/electron/ipc-api/settings.ts new file mode 100644 index 000000000..72de6866d --- /dev/null +++ b/src/electron/ipc-api/settings.ts | |||
@@ -0,0 +1,14 @@ | |||
1 | import { ipcMain, BrowserWindow, Settings } from 'electron'; | ||
2 | |||
3 | export default (params: { mainWindow: BrowserWindow; settings: Settings }) => { | ||
4 | ipcMain.on('getAppSettings', (_event, type) => { | ||
5 | params.mainWindow.webContents.send('appSettings', { | ||
6 | type, | ||
7 | data: params.settings[type].allSerialized, | ||
8 | }); | ||
9 | }); | ||
10 | |||
11 | ipcMain.on('updateAppSettings', (_event, args) => { | ||
12 | params.settings[args.type].set(args.data); | ||
13 | }); | ||
14 | }; | ||