"its more readable" statements by the deranged
This commit is contained in:
parent
b44e44686d
commit
5381340074
2 changed files with 6 additions and 4 deletions
|
@ -72,7 +72,8 @@ function init() {
|
||||||
if (isDeckGameMode) nativeTheme.themeSource = "dark";
|
if (isDeckGameMode) nativeTheme.themeSource = "dark";
|
||||||
|
|
||||||
app.on("second-instance", (_event, _cmdLine, _cwd, data: any) => {
|
app.on("second-instance", (_event, _cmdLine, _cwd, data: any) => {
|
||||||
data.IS_DEV ? app.quit() : restoreVesktop();
|
if (data.IS_DEV) app.quit();
|
||||||
|
else restoreVesktop();
|
||||||
});
|
});
|
||||||
|
|
||||||
app.whenReady().then(async () => {
|
app.whenReady().then(async () => {
|
||||||
|
|
|
@ -457,12 +457,13 @@ function createMainWindow() {
|
||||||
|
|
||||||
let uriFiredDarwin = false;
|
let uriFiredDarwin = false;
|
||||||
app.on("open-url", (_, url) => {
|
app.on("open-url", (_, url) => {
|
||||||
uriFiredDarwin ? restoreVesktop() : loadUrl(url);
|
if (uriFiredDarwin) restoreVesktop();
|
||||||
|
else loadUrl(url);
|
||||||
uriFiredDarwin = true;
|
uriFiredDarwin = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
const uri = process.argv.find(arg => arg.startsWith("discord://"));
|
const uri = process.argv.find(arg => arg.startsWith("discord://"));
|
||||||
uriFiredDarwin || loadUrl(uri);
|
if (!uriFiredDarwin) loadUrl(uri);
|
||||||
|
|
||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
@ -472,7 +473,7 @@ const runVencordMain = once(() => require(join(VENCORD_FILES_DIR, "vencordDeskto
|
||||||
export function loadUrl(uri: string | undefined) {
|
export function loadUrl(uri: string | undefined) {
|
||||||
const branch = Settings.store.discordBranch;
|
const branch = Settings.store.discordBranch;
|
||||||
const subdomain = branch === "canary" || branch === "ptb" ? `${branch}.` : "";
|
const subdomain = branch === "canary" || branch === "ptb" ? `${branch}.` : "";
|
||||||
mainWin.loadURL(`https://${subdomain}discord.com/${uri?.replace(RegExp("^discord://[^/]*/?"), "") || "app"}`);
|
mainWin.loadURL(`https://${subdomain}discord.com/${uri ? new URL(uri).pathname.slice(1) || "app" : "app"}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function restoreVesktop() {
|
export function restoreVesktop() {
|
||||||
|
|
Loading…
Reference in a new issue