mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-14 18:15:37 +00:00
feature: OliveTin now relies on websocket, and will show a big error if it isn't available (#323)
* feature: OliveTin now relies on websocket, and will show a big error if it isnt available * feature: OliveTin now relies on websocket, and will show a big error if it isnt available
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
refreshServerConnectionLabel
|
||||
} from './marshaller.js'
|
||||
|
||||
window.ws = null
|
||||
|
||||
export function checkWebsocketConnection () {
|
||||
@@ -34,6 +38,8 @@ function websocketOnOpen (evt) {
|
||||
|
||||
window.ws.send('monitor')
|
||||
|
||||
refreshServerConnectionLabel()
|
||||
|
||||
window.refreshLoop()
|
||||
}
|
||||
|
||||
@@ -58,9 +64,15 @@ function websocketOnMessage (msg) {
|
||||
function websocketOnError (err) {
|
||||
window.websocketAvailable = false
|
||||
window.refreshLoop()
|
||||
console.error(err)
|
||||
console.log(err)
|
||||
|
||||
window.showBigError('ws-connect-error', 'connecting to the websocket', 'Please see your browser console for debugging information.', true)
|
||||
|
||||
refreshServerConnectionLabel()
|
||||
}
|
||||
|
||||
function websocketOnClose () {
|
||||
window.websocketAvailable = false
|
||||
|
||||
refreshServerConnectionLabel()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user