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 => {
|
||||
const state = getState();
|
||||
const { server, channel } = state.tab.selected;
|
||||
const { nick } = state.servers.get(server);
|
||||
const [joinedChannel] = data.channels;
|
||||
if (channel &&
|
||||
server === data.server &&
|
||||
nick === data.user &&
|
||||
channel !== joinedChannel &&
|
||||
normalizeChannel(channel) === normalizeChannel(joinedChannel)) {
|
||||
dispatch(select(server, joinedChannel));
|
||||
if (server && channel) {
|
||||
const { nick } = state.servers.get(server);
|
||||
const [joinedChannel] = data.channels;
|
||||
if (server === data.server &&
|
||||
nick === data.user &&
|
||||
channel !== joinedChannel &&
|
||||
normalizeChannel(channel) === normalizeChannel(joinedChannel)) {
|
||||
dispatch(select(server, joinedChannel));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue