diff options
Diffstat (limited to 'src/store')
-rw-r--r-- | src/store/plugins/WebSocketPlugin.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/store/plugins/WebSocketPlugin.js b/src/store/plugins/WebSocketPlugin.js index 400fdefa..cf034f7a 100644 --- a/src/store/plugins/WebSocketPlugin.js +++ b/src/store/plugins/WebSocketPlugin.js @@ -20,11 +20,18 @@ const WebSocketPlugin = store => { }; const initWebSocket = () => { + const socketDisabled = + process.env.VUE_APP_SUBSCRIBE_SOCKET_DISABLED === 'true' ? true : false; + if (socketDisabled) return; const token = store.getters['authentication/token']; ws = new WebSocket(`wss://${window.location.host}/subscribe`, [token]); ws.onopen = () => { ws.send(JSON.stringify(data)); }; + ws.on('error', function(err) { + console.error('error!'); + console.error(err.code); + }); ws.onerror = event => { console.error(event); }; |