Compare commits

..

No commits in common. "7f53710d6af56e2c1b7b2c90511f66667b8d6d87" and "994ab5f5b05808a1070d07894eea92e5d1766ebb" have entirely different histories.

6 changed files with 12 additions and 48 deletions

View file

@ -34,7 +34,6 @@
},
"dependencies": {
"electron-context-menu": "github:ArmCord/electron-context-menu",
"os-locale": "^6.0.2",
"v8-compile-cache": "^2.3.0",
"ws": "^8.6.0"
},

View file

@ -12,14 +12,12 @@
<body>
<div class="container">
<div id="warning" class="hidden">
<p id="setup_offline">
You appear to be offline. Please connect to the internet and restart ArmCord Setup.
</p>
<p>You appear to be offline. Please connect to the internet and restart ArmCord Setup.</p>
</div>
<div id="setup">
<div id="logo" class="hidden"></div>
<div id="page1" class="hidden">
<p id="setup_question1">Select the type of setup you want to perform.</p>
<p>Select the type of setup you want to perform.</p>
<div id="buttons">
<button id="express" class="center">Express</button>
<button id="full" class="center">Full</button>
@ -27,7 +25,7 @@
</div>
<div id="page2" class="hidden">
<p class="text-center setup-ask" id="setup_question2">Choose your Discord channel/instance:</p>
<p class="text-center setup-ask">Choose your Discord channel/instance:</p>
<div class="center">
<select name="channel" id="channel" class="dropdown-button">
<option value="stable">Stable</option>
@ -36,9 +34,7 @@
<option value="foss">Fosscord</option>
</select>
</div>
<p class="text-center setup-ask" id="setup_question3">
Should ArmCord handle client mods installation?
</p>
<p class="text-center setup-ask">Should ArmCord handle client mods installation?</p>
<div class="center">
<select name="csp" id="csp" class="dropdown-button">
<option value="true">Yes</option>
@ -51,7 +47,7 @@
</div>
<div id="page3" class="hidden">
<p class="text-center setup-ask" id="setup_question4">Select a client mod you want to install:</p>
<p class="text-center setup-ask">Select a client mod you want to install:</p>
<div class="center">
<select name="mod" id="mod" class="dropdown-button">
<option value="cumcord">Cumcord</option>
@ -59,7 +55,7 @@
<option value="flicker">Flicker (Heavily WIP)</option>
</select>
</div>
<p class="text-center" id="setup_question4_clientmodnotice">
<p class="text-center">
Why not all of them? Having many client mods at the same time can cause issues. If you really
want to do it though, check our Discord ;)
</p>
@ -69,25 +65,7 @@
</div>
</div>
</div>
<script>
async function loadLang() {
document.getElementById("next").innerHTML = await armcord.getLang("next");
document.getElementById("setup_offline").innerHTML = await armcord.getLang("setup_offline");
document.getElementById("setup_question1").innerHTML = await armcord.getLang("setup_question1");
document.getElementById("express").innerHTML = await armcord.getLang("setup_question1_answer1");
document.getElementById("full").innerHTML = await armcord.getLang("setup_question1_answer2");
document.getElementById("setup_question2").innerHTML = await armcord.getLang("setup_question2");
document.getElementById("setup_question3").innerHTML = await armcord.getLang("setup_question3");
document.getElementById("setup_question4").innerHTML = await armcord.getLang("setup_question4");
document.getElementById("setup_question4_clientmodnotice").innerHTML = await armcord.getLang(
"setup_question4_clientmodnotice"
);
//select stuff1
document.getElementById("csp").options[1].text = await armcord.getLang("no");
document.getElementById("csp").options[0].text = await armcord.getLang("yes");
}
loadLang();
</script>
<script>
document.onload = function () {
ipcRenderer.send("win-unmaximize");

View file

@ -60,9 +60,6 @@ export function registerIpc() {
ipcMain.on("channel", async (event) => {
event.returnValue = await getConfig("channel");
});
ipcMain.handle("getLang", (event, toGet: string) => {
return getLang(toGet);
});
ipcMain.on("clientmod", async (event, arg) => {
event.returnValue = await getConfig("mods");
});

View file

@ -17,10 +17,6 @@ contextBridge.exposeInMainWorld("armcord", {
channel: ipcRenderer.sendSync("channel"),
openTab: (number: number) => ipcRenderer.sendSync("openTab", number),
setLang: (lang: string) => ipcRenderer.send("setLang", lang),
getLang: (toGet: string) =>
ipcRenderer.invoke("getLang", toGet).then((result) => {
return result;
}),
version: ipcRenderer.sendSync("get-app-version", "app-version"),
getDisplayMediaSelector: getDisplayMediaSelector,
openSettingsWindow: () => ipcRenderer.send("openSettingsWindow")

View file

@ -9,13 +9,9 @@ import {ipcRenderer} from "electron";
import {injectTabs} from "./tabs";
var version = ipcRenderer.sendSync("get-app-version", "app-version");
async function updateLang() {
if (window.location.href.indexOf("setup.html") > -1) {
console.log("Setup, skipping lang update");
} else {
addScript(`function getDiscordLang() {
{const _w=webpackChunkdiscord_app;let lang;_w.push([[Symbol()],{},e=>{for(const k in e.c){const m=e.c[k].exports;const mDef=m?.default&&m.__esModule?m.default:m;if(mDef?._chosenLocale&&!lang)lang=mDef}}]);_w.pop();window.armcord.setLang(lang._chosenLocale);return lang._chosenLocale;void 0}}
getDiscordLang();`);
}
}
declare global {
interface Window {

View file

@ -4,7 +4,7 @@
// I'm sorry for this mess but I'm not sure how to fix it.
import {BrowserWindow, shell, app, ipcMain, dialog, clipboard} from "electron";
import path from "path";
import {checkIfConfigIsBroken, firstRun, getConfig, contentPath, isSetup, setConfig, setLang} from "./utils";
import {checkIfConfigIsBroken, firstRun, getConfig, contentPath, isSetup, setConfig} from "./utils";
import {registerIpc} from "./ipc";
import startServer from "./socket";
import contextMenu from "electron-context-menu";
@ -85,10 +85,10 @@ async function doAfterDefiningTheWindow() {
if ((await getConfig("inviteWebsocket")) == true) {
startServer();
}
try {
mainWindow.loadFile(contentPath);
if (isSetup) {
await setLang(Intl.DateTimeFormat().resolvedOptions().locale)
mainWindow.setSize(390, 470);
}
} catch (e) {
@ -98,7 +98,6 @@ async function doAfterDefiningTheWindow() {
console.log(process.platform);
if (process.platform === "win32") {
if (firstRun) {
await setLang(Intl.DateTimeFormat().resolvedOptions().locale)
mainWindow.setSize(390, 470);
mainWindow.loadURL(`file://${__dirname}/content/setup.html`);
} else {
@ -106,7 +105,6 @@ async function doAfterDefiningTheWindow() {
}
} else {
if (firstRun) {
await setLang(Intl.DateTimeFormat().resolvedOptions().locale)
mainWindow.setSize(390, 470);
mainWindow.loadURL(`file://${__dirname}/ts-out/content/setup.html`);
} else {