forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsocket.ts
More file actions
30 lines (26 loc) · 778 Bytes
/
socket.ts
File metadata and controls
30 lines (26 loc) · 778 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
import Status from '../../helpers/statuses';
import {SocketState} from "../types";
export default {
namespaced: true,
state: {
connected: false,
connectionError: false,
status: Status.STATUS_OFF,
},
mutations: {
SOCKET_CONNECT: (state: SocketState) => {
state.connected = true;
state.connectionError = false;
},
SOCKET_ERROR: (state: SocketState, err: Error) => {
state.connected = false;
state.connectionError = err;
},
'SOCKET_INITIAL STATUS': (state: SocketState, data: string) => {
state.status = data;
},
SOCKET_STATUS: (state: SocketState, data: string) => {
state.status = data;
}
},
};