소스 검색

refactor(ota): 修改发送更新状态到窗口的方法

- 将 CoreWindow.getMainWindow() 替换为 this.app.electron['ota'] 的使用
- 注释掉原有的代码块,保留备用逻辑
panqiuyao 5 달 전
부모
커밋
38639aeabc
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      electron/controller/ota.js

+ 3 - 2
electron/controller/ota.js

@@ -148,8 +148,9 @@ class OTAController extends Controller {
   sendStatusToWindow(content = {}) {
     const textJson = JSON.stringify(content);
     const channel = 'app.updater';
-    const win = CoreWindow.getMainWindow();
-    win.webContents.send(channel, textJson);
+    this.app.electron['ota'].webContents.send(channel, textJson);
+/*    const win = CoreWindow.getMainWindow();
+    win.webContents.send(channel, textJson);*/
   }
 
   /**