diff --git a/components/app.js b/components/app.js index 1640cbd..eac383c 100644 --- a/components/app.js +++ b/components/app.js @@ -906,7 +906,7 @@ export default class App extends Component { event.preventDefault(); - let buf = State.getBuffer(this.state, { server: serverID, name: url.channel }); + let buf = State.getBuffer(this.state, { server: serverID, name: url.channel || SERVER_BUFFER }); if (buf) { this.switchBuffer(buf.id); } else { diff --git a/lib/irc.js b/lib/irc.js index 95b7860..54f1b9b 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -666,17 +666,17 @@ export function parseURL(str) { let i = str.indexOf("/"); if (i < 0) { - return null; + return { host: str }; } let host = str.slice(0, i); str = str.slice(i + 1); // TODO: handle URLs with query params - if (!str.startsWith("#")) { - return null; + let channel = null; + if (str.startsWith("#")) { + channel = str; } - let channel = str; return { host, channel }; }