Update to E28

This commit is contained in:
smartfrigde 2024-01-19 11:22:41 +01:00
parent f678b7fd42
commit 6beee8d825
4 changed files with 35 additions and 24 deletions

View file

@ -36,7 +36,7 @@
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"copyfiles": "^2.4.1",
"electron": "27.2.0",
"electron": "28.1.4",
"electron-builder": "^24.6.3",
"eslint": "^8.40.0",
"eslint-config-dmitmel": "github:dmitmel/eslint-config-dmitmel",

View file

@ -41,8 +41,8 @@ devDependencies:
specifier: ^2.4.1
version: 2.4.1
electron:
specifier: 27.2.0
version: 27.2.0
specifier: 28.1.4
version: 28.1.4
electron-builder:
specifier: ^24.6.3
version: 24.6.3
@ -1027,8 +1027,8 @@ packages:
- supports-color
dev: true
/electron@27.2.0:
resolution: {integrity: sha512-no/iMICVLI/5G0IqgKFbB89HDN88DWwKeRO+dPfJPkpJISdEX8Cx/sMEOFuuRa4VNInNe5CKCqRWExK5z3AdcQ==}
/electron@28.1.4:
resolution: {integrity: sha512-WE6go611KOhtH6efRPMnVC7FE7DCKnQ3ZyHFeI1DbaCy8OU4UjZ8/CZGcuZmZgRdxSBEHoHdgaJkWRHZzF0FOg==}
engines: {node: '>= 12.20.55'}
hasBin: true
requiresBuild: true

27
src/splash/redirect.html Normal file
View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<title>Loading</title>
</head>
<body>
<h1>Loading Discord</h1>
<script>
switch (window.armcord.channel) {
case "stable":
window.location.replace("https://discord.com/app");
break;
case "canary":
window.location.replace("https://canary.discord.com/app");
break;
case "ptb":
window.location.replace("https://ptb.discord.com/app");
break;
case undefined:
window.location.replace("https://discord.com/app");
break;
default:
window.location.replace("https://discord.com/app");
}
</script>
</body>
</html>

View file

@ -274,25 +274,9 @@ async function doAfterDefiningTheWindow(): Promise<void> {
if (firstRun) {
mainWindow.close();
}
mainWindow.loadURL("data:text/html,%3Ch1%3ELoading%21%3C%2Fh1%3E");
mainWindow.webContents.executeJavaScript(`
switch (window.armcord.channel) {
case "stable":
window.location.replace("https://discord.com/app");
break;
case "canary":
window.location.replace("https://canary.discord.com/app");
break;
case "ptb":
window.location.replace("https://ptb.discord.com/app");
break;
case undefined:
window.location.replace("https://discord.com/app");
break;
default:
window.location.replace("https://discord.com/app");
}
`);
//loadURL broke for no good reason after E28
mainWindow.loadFile("splash/redirect.html");
if (await getConfig("skipSplash")) {
mainWindow.show();
}