Better handling of connection errors

This commit is contained in:
Dane Everitt
2018-08-06 21:33:43 -07:00
parent f1ec968f38
commit f20d40460e
3 changed files with 28 additions and 11 deletions

View File

@@ -4,7 +4,7 @@ export default {
namespaced: true,
state: {
connected: false,
connectionError: null,
connectionError: false,
status: Status.STATUS_OFF,
},
actions: {
@@ -12,9 +12,16 @@ export default {
mutations: {
SOCKET_CONNECT: (state) => {
state.connected = true;
state.connectionError = false;
},
SOCKET_ERROR: (state, err) => {
state.connected = false;
state.connectionError = err;
},
SOCKET_CONNECT_ERROR: (state, err) => {
state.connected = false;
state.connectionError = err;
},