Properly check if a channel is selected in socket.on('join')
This commit is contained in:
parent
58caacd269
commit
d2284551de
File diff suppressed because one or more lines are too long
|
@ -23,15 +23,16 @@ export default function handleSocket(socket, { dispatch, getState }) {
|
|||
socket.on('join', data => {
|
||||
const state = getState();
|
||||
const { server, channel } = state.tab.selected;
|
||||
if (server && channel) {
|
||||
const { nick } = state.servers.get(server);
|
||||
const [joinedChannel] = data.channels;
|
||||
if (channel &&
|
||||
server === data.server &&
|
||||
if (server === data.server &&
|
||||
nick === data.user &&
|
||||
channel !== joinedChannel &&
|
||||
normalizeChannel(channel) === normalizeChannel(joinedChannel)) {
|
||||
dispatch(select(server, joinedChannel));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('servers', data => {
|
||||
|
|
Loading…
Reference in New Issue