fix #6694 - correctly save downloaded config

This commit is contained in:
Qianfan Jiang 2022-08-01 00:39:52 +01:00 committed by Eugene
parent 697bbfcfe1
commit 04407b38c8
3 changed files with 4 additions and 4 deletions

View File

@ -31,7 +31,7 @@ export class Application {
this.useBuiltinGraphics() this.useBuiltinGraphics()
this.ptyManager.init(this) this.ptyManager.init(this)
ipcMain.on('app:save-config', async (event, config) => { ipcMain.handle('app:save-config', async (event, config) => {
await saveConfig(config) await saveConfig(config)
this.broadcastExcept('host:config-change', event.sender, config) this.broadcastExcept('host:config-change', event.sender, config)
}) })

View File

@ -58,8 +58,8 @@ export class ElectronHostAppService extends HostAppService {
this.electron.ipcRenderer.send('app:new-window') this.electron.ipcRenderer.send('app:new-window')
} }
saveConfig (data: string): void { async saveConfig (data: string): Promise<void> {
this.electron.ipcRenderer.send('app:save-config', data) await this.electron.ipcRenderer.invoke('app:save-config', data)
} }
emitReady (): void { emitReady (): void {

View File

@ -109,7 +109,7 @@ export class ElectronPlatformService extends PlatformService {
} }
async saveConfig (content: string): Promise<void> { async saveConfig (content: string): Promise<void> {
this.hostApp.saveConfig(content) await this.hostApp.saveConfig(content)
} }
getConfigPath (): string|null { getConfigPath (): string|null {