Make sure the cookie stored channel exists on the correct server

This commit is contained in:
Ken-Håvard Lieng 2018-04-26 20:25:41 +02:00
parent e132c8201f
commit 1b202e7c2b
2 changed files with 26 additions and 20 deletions

File diff suppressed because one or more lines are too long

View File

@ -23,7 +23,13 @@ export default function initialState({ store }) {
if (tab) { if (tab) {
const [server, name = null] = tab.split(/;(.+)/); const [server, name = null] = tab.split(/;(.+)/);
if (name && find(env.channels, chan => chan.name === name)) { if (
name &&
find(
env.channels,
chan => chan.server === server && chan.name === name
)
) {
store.dispatch(select(server, name, true)); store.dispatch(select(server, name, true));
} else if (find(env.servers, srv => srv.host === server)) { } else if (find(env.servers, srv => srv.host === server)) {
store.dispatch(select(server, null, true)); store.dispatch(select(server, null, true));