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 <mateuszx.gapski@intel.com>
Change-Id: I09d66474480dcb37393ecff5d46c4ee0e9052f99
diff --git a/.env.intel b/.env.intel
index 74a21b9..731a125 100644
--- a/.env.intel
+++ b/.env.intel
@@ -1,3 +1,4 @@
 NODE_ENV=production
 VUE_APP_ENV_NAME="intel"
 VUE_APP_COMPANY_NAME="intel"
+VUE_APP_SUBSCRIBE_SOCKET_DISABLED="true"
\ No newline at end of file
diff --git a/src/store/plugins/WebSocketPlugin.js b/src/store/plugins/WebSocketPlugin.js
index 400fdef..cf034f7 100644
--- a/src/store/plugins/WebSocketPlugin.js
+++ b/src/store/plugins/WebSocketPlugin.js
@@ -20,11 +20,18 @@
   };
 
   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);
     };