Handle IRC URLs without channel name
This commit is contained in:
parent
3562478946
commit
a120d79585
2 changed files with 5 additions and 5 deletions
|
@ -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 };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue