forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsocket.js
More file actions
36 lines (31 loc) · 841 Bytes
/
socket.js
File metadata and controls
36 lines (31 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import Status from './../../helpers/statuses';
export default {
namespaced: true,
state: {
connected: false,
connectionError: false,
status: Status.STATUS_OFF,
},
actions: {
},
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;
},
'SOCKET_INITIAL STATUS': (state, data) => {
state.status = data.status;
},
SOCKET_STATUS: (state, data) => {
state.status = data.status;
}
},
};