From 33a8c5369e0253a93dba2e70647bda1c7697b73b Mon Sep 17 00:00:00 2001 From: Mateusz Gapski Date: Fri, 24 Jul 2020 08:52:53 +0200 Subject: Add the possibility to disable subscribe socket Intel does not support subscribe socket yet. I don't want to try to connect with this socket becuase it crashes entire app in development mode. Signed-off-by: Mateusz Gapski Change-Id: I09d66474480dcb37393ecff5d46c4ee0e9052f99 --- src/store/plugins/WebSocketPlugin.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/store/plugins') 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); }; -- cgit v1.2.3