Небольшие поправки
This commit is contained in:
@@ -52,12 +52,13 @@ class WebSocketConnection {
|
||||
return this.listeners.length != len;
|
||||
}
|
||||
|
||||
open() {
|
||||
open(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.ws && this.ws.readyState == WebSocket.OPEN) {
|
||||
resolve(this.ws);
|
||||
} else {
|
||||
this.ws = new WebSocket(`ws://${window.location.host}`);
|
||||
url = url || `ws://${window.location.host}/ws`;
|
||||
this.ws = new WebSocket(url);
|
||||
|
||||
if (this.timer) {
|
||||
clearTimeout(this.timer);
|
||||
|
||||
@@ -36,6 +36,7 @@ class Reader {
|
||||
return response;
|
||||
} catch (e) {
|
||||
//
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
//с WebSocket проблема, проверяем по http
|
||||
|
||||
Reference in New Issue
Block a user