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