mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Structure change (#4220)
* Structure change * Remove duplicate folders from previous structure * Cleanup websocket protocol * Updating from based off PR * Fixup - remove wrong files during conflict and get the websocket working * renaming tsx to ts Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
a0deb73df6
commit
1ddc9cc929
123 changed files with 424 additions and 228 deletions
68
webclient/src/store/server/server.dispatch.ts
Normal file
68
webclient/src/store/server/server.dispatch.ts
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
import { reset } from 'redux-form';
|
||||
import { Actions } from "./server.actions";
|
||||
import { store } from "store";
|
||||
|
||||
export const Dispatch = {
|
||||
clearStore: () => {
|
||||
store.dispatch(Actions.clearStore());
|
||||
},
|
||||
connectServer: () => {
|
||||
store.dispatch(Actions.connectServer());
|
||||
},
|
||||
connectionClosed: reason => {
|
||||
store.dispatch(Actions.connectionClosed(reason));
|
||||
},
|
||||
updateBuddyList: buddyList => {
|
||||
store.dispatch(Actions.updateBuddyList(buddyList));
|
||||
},
|
||||
addToBuddyList: user => {
|
||||
store.dispatch(reset('addToBuddies'));
|
||||
store.dispatch(Actions.addToBuddyList(user));
|
||||
},
|
||||
removeFromBuddyList: userName => {
|
||||
store.dispatch(Actions.removeFromBuddyList(userName));
|
||||
},
|
||||
updateIgnoreList: ignoreList => {
|
||||
store.dispatch(Actions.updateIgnoreList(ignoreList));
|
||||
},
|
||||
addToIgnoreList: user => {
|
||||
store.dispatch(reset('addToIgnore'));
|
||||
store.dispatch(Actions.addToIgnoreList(user));
|
||||
},
|
||||
removeFromIgnoreList: userName => {
|
||||
store.dispatch(Actions.removeFromIgnoreList(userName));
|
||||
},
|
||||
updateInfo: (name, version) => {
|
||||
store.dispatch(Actions.updateInfo({
|
||||
name,
|
||||
version
|
||||
}));
|
||||
},
|
||||
updateStatus: (state, description) => {
|
||||
store.dispatch(Actions.updateStatus({
|
||||
state,
|
||||
description
|
||||
}));
|
||||
},
|
||||
updateUser: user => {
|
||||
store.dispatch(Actions.updateUser(user));
|
||||
},
|
||||
updateUsers: users => {
|
||||
store.dispatch(Actions.updateUsers(users));
|
||||
},
|
||||
userJoined: user => {
|
||||
store.dispatch(Actions.userJoined(user));
|
||||
},
|
||||
userLeft: name => {
|
||||
store.dispatch(Actions.userLeft(name));
|
||||
},
|
||||
viewLogs: name => {
|
||||
store.dispatch(Actions.viewLogs(name));
|
||||
},
|
||||
clearLogs: () => {
|
||||
store.dispatch(Actions.clearLogs());
|
||||
},
|
||||
serverMessage: message => {
|
||||
store.dispatch(Actions.serverMessage(message));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue