mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-24 20:21:53 +08:00
fix: 断开连接
This commit is contained in:
+2
-1
@@ -27,7 +27,7 @@ export class WebSocketManager {
|
||||
};
|
||||
|
||||
this.socket.onclose = () => {
|
||||
chrome.runtime.sendMessage({action: ActionType.STATUS, connected: false, port: port});
|
||||
chrome.runtime.sendMessage({action: ActionType.STATUS, connected: false});
|
||||
};
|
||||
|
||||
this.socket.onerror = (error) => {
|
||||
@@ -39,6 +39,7 @@ export class WebSocketManager {
|
||||
if (this.socket) {
|
||||
try {
|
||||
this.socket.close();
|
||||
chrome.runtime.sendMessage({action: ActionType.STATUS, connected: false});
|
||||
} catch (e) {
|
||||
console.error("Error closing websocket:", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user