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');