update uri matching

attempt to cover malformed or incomplete uris

Use RegExp to avoid escape character hell
This commit is contained in:
Kylie C 2024-08-16 11:08:27 -04:00
parent 60d6c84542
commit 42f76b79aa

View file

@ -460,7 +460,7 @@ function createMainWindow() {
const uri = process.argv.find(arg => arg.startsWith("discord://"));
const loadUrl = (url: string | undefined) => {
win.loadURL(`https://${subdomain}discord.com${url?.substring("discord://".length) || "/app"}`);
win.loadURL(`https://${subdomain}discord.com/${url?.replace(RegExp("^discord://[^/]*/?"), "") || "app"}`);
};
let uriFiredDarwin = false;