diff --git a/app/lib/app.ts b/app/lib/app.ts index bfe156e0..5a0e3c48 100644 --- a/app/lib/app.ts +++ b/app/lib/app.ts @@ -31,7 +31,7 @@ export class Application { this.useBuiltinGraphics() this.ptyManager.init(this) - ipcMain.on('app:save-config', async (event, config) => { + ipcMain.handle('app:save-config', async (event, config) => { await saveConfig(config) this.broadcastExcept('host:config-change', event.sender, config) }) diff --git a/tabby-electron/src/services/hostApp.service.ts b/tabby-electron/src/services/hostApp.service.ts index 8eb2d841..299a4d1f 100644 --- a/tabby-electron/src/services/hostApp.service.ts +++ b/tabby-electron/src/services/hostApp.service.ts @@ -58,8 +58,8 @@ export class ElectronHostAppService extends HostAppService { this.electron.ipcRenderer.send('app:new-window') } - saveConfig (data: string): void { - this.electron.ipcRenderer.send('app:save-config', data) + async saveConfig (data: string): Promise { + await this.electron.ipcRenderer.invoke('app:save-config', data) } emitReady (): void { diff --git a/tabby-electron/src/services/platform.service.ts b/tabby-electron/src/services/platform.service.ts index 30b7fc4a..806a15dd 100644 --- a/tabby-electron/src/services/platform.service.ts +++ b/tabby-electron/src/services/platform.service.ts @@ -109,7 +109,7 @@ export class ElectronPlatformService extends PlatformService { } async saveConfig (content: string): Promise { - this.hostApp.saveConfig(content) + await this.hostApp.saveConfig(content) } getConfigPath (): string|null {