mirror of
https://github.com/HugoAura/Seewo-HugoAura.git
synced 2026-06-21 23:54:26 +08:00
[🤯 Refactor] Use standalone window for WebSocket connections
1. [-] 删除了对于 desktopAssistant 的 Hook 逻辑 2. [/] 现在不再使用 desktopAssistant 保活 WS 连接, 而是用一个单独的不可见窗口处理 WS (#25)
This commit is contained in:
@@ -47,6 +47,7 @@ const NetworkHook = require("../aura/init/rendererHook/networkHook");
|
||||
const ConfigManager = require("../aura/init/shared/configManager");
|
||||
const RegistryManager = require("../aura/init/shared/registryManager");
|
||||
const { buildIpcMain } = require("../aura/init/main/ipcHandler");
|
||||
const plsUtils = require("../aura/utils/pls");
|
||||
|
||||
const { initLogger } = require("../aura/init/main/logger");
|
||||
|
||||
@@ -97,7 +98,10 @@ const launcher = ({ central, windowName, config }) => {
|
||||
app.exit(0);
|
||||
};
|
||||
|
||||
global.__HUGO_AURA__.auraDir = path.join(getUserDocumentsDirPath(), "HugoAura");
|
||||
global.__HUGO_AURA__.auraDir = path.join(
|
||||
getUserDocumentsDirPath(),
|
||||
"HugoAura"
|
||||
);
|
||||
|
||||
// >>> Init Logger <<< //
|
||||
initLogger(windowName);
|
||||
@@ -146,6 +150,13 @@ const launcher = ({ central, windowName, config }) => {
|
||||
config.canOpenDevTool = true;
|
||||
}
|
||||
|
||||
// >>> Create WebSocket KeepAlive Window <<< //
|
||||
if (!global.__HUGO_AURA__.hookedWindows?.has("auraWsKeepAlive")) {
|
||||
const wsKaWin = plsUtils.createWsWindow(electron);
|
||||
// @ts-expect-error
|
||||
global.__HUGO_AURA__.hookedWindows.set("auraWsKeepAlive", wsKaWin);
|
||||
}
|
||||
|
||||
// >>> Listeners <<< //
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user