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,14 +23,15 @@ export default function handleSocket(socket, { dispatch, getState }) {
|
||||||
socket.on('join', data => {
|
socket.on('join', data => {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const { server, channel } = state.tab.selected;
|
const { server, channel } = state.tab.selected;
|
||||||
const { nick } = state.servers.get(server);
|
if (server && channel) {
|
||||||
const [joinedChannel] = data.channels;
|
const { nick } = state.servers.get(server);
|
||||||
if (channel &&
|
const [joinedChannel] = data.channels;
|
||||||
server === data.server &&
|
if (server === data.server &&
|
||||||
nick === data.user &&
|
nick === data.user &&
|
||||||
channel !== joinedChannel &&
|
channel !== joinedChannel &&
|
||||||
normalizeChannel(channel) === normalizeChannel(joinedChannel)) {
|
normalizeChannel(channel) === normalizeChannel(joinedChannel)) {
|
||||||
dispatch(select(server, joinedChannel));
|
dispatch(select(server, joinedChannel));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue