mirror of
https://github.com/HugoAura/Seewo-HugoAura.git
synced 2026-06-23 09:14:28 +08:00
[🤯 Refactor] Use standalone window for WebSocket connections
1. [-] 删除了对于 desktopAssistant 的 Hook 逻辑 2. [/] 现在不再使用 desktopAssistant 保活 WS 连接, 而是用一个单独的不可见窗口处理 WS (#25)
This commit is contained in:
@@ -418,7 +418,7 @@ const applyPlsIpcHandler = (ipcMain) => {
|
||||
*/
|
||||
(_event, arg) => {
|
||||
ipcMain.send(
|
||||
"desktopAssistant",
|
||||
"auraWsKeepAlive",
|
||||
`${methodBase}.ws.post.onReqSendMsg`,
|
||||
arg
|
||||
);
|
||||
@@ -568,7 +568,7 @@ const applyPlsIpcHandler = (ipcMain) => {
|
||||
status: "Already",
|
||||
};
|
||||
} else {
|
||||
ipcMain.send("desktopAssistant", `${methodBase}.retryPlsConnect`, arg);
|
||||
ipcMain.send("auraWsKeepAlive", `${methodBase}.retryPlsConnect`, arg);
|
||||
|
||||
return {
|
||||
success: true,
|
||||
|
||||
@@ -14,7 +14,7 @@ class WindowHooksManager {
|
||||
|
||||
const hooksPath = path.join(__dirname, "../../../aura/mainProcess/hooks");
|
||||
|
||||
/** @type {import("../../types/main/core").HooksMap} */
|
||||
/** @type {import("../../types/main/core").UIHooksMap} */
|
||||
const hooks = new Map();
|
||||
|
||||
try {
|
||||
@@ -55,6 +55,9 @@ class WindowHooksManager {
|
||||
browserWindowInstance
|
||||
) {
|
||||
const stripWindowName = windowName.split("_")[0];
|
||||
|
||||
if (!global.__HUGO_AURA__.windowHooks) return;
|
||||
|
||||
if (!global.__HUGO_AURA__.windowHooks.has(stripWindowName)) {
|
||||
console.log(
|
||||
`[HugoAura / Init / WDH] Window ${windowName} has no corresponding main process hooks, ignoring...`
|
||||
|
||||
Reference in New Issue
Block a user