Browse Source

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

- 将 CoreWindow.getMainWindow() 替换为 this.app.electron['ota'] 的使用
- 注释掉原有的代码块,保留备用逻辑
panqiuyao 5 months ago
parent
commit
38639aeabc
1 changed files with 3 additions and 2 deletions
  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);*/
   }
 
   /**