fix: use url.toString()

This commit is contained in:
Derrick Hammer 2023-10-16 19:50:58 -04:00
parent 59cadac430
commit 02c2a59938
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 4 deletions

View File

@ -146,10 +146,7 @@ export function Navigator() {
// Try to parse it as a URL
const url = new URL(input);
setUrl(
`${url.hostname}${url.pathname}${url.search}${url.hash}` ||
"about:blank",
);
setUrl(url.toString() || "about:blank");
} catch (e) {
// Handle invalid URLs here, if needed
console.error("Invalid URL:", e);