瀏覽代碼

fix #6694 - correctly save downloaded config

Qianfan Jiang 3 年之前
父節點
當前提交
04407b38c8
共有 3 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      app/lib/app.ts
  2. 2 2
      tabby-electron/src/services/hostApp.service.ts
  3. 1 1
      tabby-electron/src/services/platform.service.ts

+ 1 - 1
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)
         })

+ 2 - 2
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<void> {
+        await this.electron.ipcRenderer.invoke('app:save-config', data)
     }
 
     emitReady (): void {

+ 1 - 1
tabby-electron/src/services/platform.service.ts

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