Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
YeonV committed Jan 14, 2025
1 parent 0eb8ef3 commit 2897e6c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/utils/Websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ interface WebSockette extends Sockette {
ws: WebSocket
}

let YZFLAG = false

function createSocket() {
const host =
window.localStorage.getItem('ledfx-host') ||
Expand All @@ -31,6 +33,10 @@ function createSocket() {
console.warn(
'Mixed content error: Cannot connect to ws:// from an https:// page.'
)
return undefined
}

if (YZFLAG) {
return 'mixedContent'
}

Expand Down Expand Up @@ -150,8 +156,11 @@ function createSocket() {
}
})
)
},
onerror: (e) => {
console.log('OMG Error:', e)
YZFLAG = true
}
// onerror: e => console.log('Error:', e)
}) as WebSockette
return _ws
} catch (error) {
Expand Down

0 comments on commit 2897e6c

Please sign in to comment.