2018-08-02 06:37:14 +00:00
|
|
|
import Status from './../../helpers/statuses';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
namespaced: true,
|
|
|
|
state: {
|
|
|
|
connected: false,
|
2018-08-07 04:33:43 +00:00
|
|
|
connectionError: false,
|
2018-08-02 06:37:14 +00:00
|
|
|
status: Status.STATUS_OFF,
|
|
|
|
},
|
|
|
|
actions: {
|
|
|
|
},
|
|
|
|
mutations: {
|
|
|
|
SOCKET_CONNECT: (state) => {
|
|
|
|
state.connected = true;
|
2018-08-07 04:33:43 +00:00
|
|
|
state.connectionError = false;
|
2018-08-02 06:37:14 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
SOCKET_ERROR: (state, err) => {
|
2018-08-07 04:33:43 +00:00
|
|
|
state.connected = false;
|
|
|
|
state.connectionError = err;
|
|
|
|
},
|
|
|
|
|
|
|
|
SOCKET_CONNECT_ERROR: (state, err) => {
|
|
|
|
state.connected = false;
|
2018-08-02 06:37:14 +00:00
|
|
|
state.connectionError = err;
|
|
|
|
},
|
|
|
|
|
|
|
|
'SOCKET_INITIAL STATUS': (state, data) => {
|
|
|
|
state.status = data.status;
|
|
|
|
},
|
|
|
|
|
|
|
|
SOCKET_STATUS: (state, data) => {
|
|
|
|
state.status = data.status;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|