Skip to content

Commit

Permalink
feat: add websocket error to snackbar
Browse files Browse the repository at this point in the history
  • Loading branch information
tympanix committed Jul 10, 2018
1 parent 214c5fd commit 99c654e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/js/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ class Websocket extends EventEmitter {

__create() {
this.__proto = document.location.protocol === "http:" ? "ws://" : "wss://"
this.__path = join(document.location.host, this.__proxypath || "", "/api/ws")
this.__path = join(document.location.host, this.__proxypath || "", "/api/wss")
this.ws = new WebSocket(this.__proto + this.__path)
this.ws.onerror = function(evt) {
Snackbar.error("Websocket", "Could not instantiate connection :(", "WS")
}
this.ws.onmessage = this.__handle.bind(this)
}

Expand Down

0 comments on commit 99c654e

Please sign in to comment.