Skip to content

Commit 2eaba45

Browse files
committed
Revert "frontend: multiplexer: add typeof guards for WebSocket global references"
This reverts commit 8e76184.
1 parent 8e76184 commit 2eaba45

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

frontend/src/lib/k8s/api/v2/multiplexer.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,15 @@ export const WebSocketManager = {
7676
*/
7777
async connect(): Promise<WebSocket> {
7878
// Return existing connection if available
79-
if (typeof WebSocket !== 'undefined' && this.socketMultiplexer?.readyState === WebSocket.OPEN) {
79+
if (this.socketMultiplexer?.readyState === WebSocket.OPEN) {
8080
return this.socketMultiplexer;
8181
}
8282

8383
// Wait for existing connection attempt if in progress
8484
if (this.connecting) {
8585
return new Promise(resolve => {
8686
const checkConnection = setInterval(() => {
87-
if (
88-
typeof WebSocket !== 'undefined' &&
89-
this.socketMultiplexer?.readyState === WebSocket.OPEN
90-
) {
87+
if (this.socketMultiplexer?.readyState === WebSocket.OPEN) {
9188
clearInterval(checkConnection);
9289
resolve(this.socketMultiplexer);
9390
}
@@ -237,10 +234,7 @@ export const WebSocketManager = {
237234
this.activeSubscriptions.delete(key);
238235
this.completedPaths.delete(key);
239236

240-
if (
241-
typeof WebSocket !== 'undefined' &&
242-
this.socketMultiplexer?.readyState === WebSocket.OPEN
243-
) {
237+
if (this.socketMultiplexer?.readyState === WebSocket.OPEN) {
244238
const userId = getUserIdFromLocalStorage();
245239
const closeMsg: WebSocketMessage = {
246240
clusterId,

0 commit comments

Comments
 (0)