From d6aa6b38f7b53f71ee6e8692f8846aa935d94f93 Mon Sep 17 00:00:00 2001 From: zealotchen Date: Wed, 6 Nov 2024 21:40:15 +0800 Subject: [PATCH] feat(vue-next): fix websocket event not bind --- .../hippy-vue-next/src/runtime/websocket/websocket.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/driver/js/packages/hippy-vue-next/src/runtime/websocket/websocket.ts b/driver/js/packages/hippy-vue-next/src/runtime/websocket/websocket.ts index 56291434bf5..77eb576a5e9 100644 --- a/driver/js/packages/hippy-vue-next/src/runtime/websocket/websocket.ts +++ b/driver/js/packages/hippy-vue-next/src/runtime/websocket/websocket.ts @@ -52,9 +52,6 @@ const WEB_SOCKET_MODULE_NAME = 'websocket'; // native event name for websocket const WEB_SOCKET_NATIVE_EVENT = 'hippyWebsocketEvents'; -// whether the websocket event listener has been bound -let isBindWebsocketEvent = false; - /** * determine whether it is a legitimate websocket event * @@ -116,11 +113,7 @@ class WebSocket { ...extrasHeaders, }; - if (!isBindWebsocketEvent) { - // The bus is global, if it is multi-instance, there may be problems, to be verified fixme - isBindWebsocketEvent = true; - EventBus.$on(WEB_SOCKET_NATIVE_EVENT, this.onWebSocketEvent); - } + EventBus.$on(WEB_SOCKET_NATIVE_EVENT, this.onWebSocketEvent); if (!url) { throw new TypeError('Invalid WebSocket url');