Add topic modal

This commit is contained in:
Ken-Håvard Lieng 2019-01-25 03:57:58 +01:00
parent aab1ad3e99
commit 24960f23b9
11 changed files with 235 additions and 172 deletions

View file

@ -61,7 +61,7 @@ function init(state, server, channel) {
state[server] = {};
}
if (channel && !state[server][channel]) {
state[server][channel] = { users: [], joined: false };
state[server][channel] = { name: channel, users: [], joined: false };
}
}
@ -135,6 +135,7 @@ export default createReducer(
[actions.socket.JOIN](state, { server, channels, user }) {
const channel = channels[0];
init(state, server, channel);
state[server][channel].name = channel;
state[server][channel].joined = true;
state[server][channel].users.push(createUser(user));
},