From 8f0f027d0a6bd0ab1fbfe49c850ff9ddbe4613de Mon Sep 17 00:00:00 2001 From: OmegaRogue Date: Mon, 22 Jan 2024 16:54:23 +0100 Subject: [PATCH 1/3] :bug: Fix checkboxes in config menu --- src/main.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 7054912..5493e0a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,6 +11,7 @@ app.commandLine.appendSwitch("enable-features", "SharedArrayBuffer"); /* Remove the comment (//) from the line below to ignore certificate errors (useful for self-signed certificates) */ +getAppConfig(); //app.commandLine.appendSwitch("ignore-certificate-errors"); function getUserData(): UserData { @@ -245,11 +246,11 @@ function getAppConfig(): AppConfig { try { const json = fs.readFileSync(path.join(app.getAppPath(), "config.json")).toString(); let appConfig = JSON.parse(json) as AppConfig; + const userData = getUserData(); + appConfig = {...appConfig, ...userData.app}; if (appConfig.ignoreCertificateErrors) { app.commandLine.appendSwitch("ignore-certificate-errors"); } - const userData = getUserData(); - appConfig = {...appConfig, ...userData.app}; return appConfig; } catch (e) { return {} as AppConfig; From d1edc66a88f7a5f63cd73edae4a5b6933609cb68 Mon Sep 17 00:00:00 2001 From: OmegaRogue Date: Tue, 23 Jan 2024 22:37:41 +0100 Subject: [PATCH 2/3] :bug: Fix export local config --- index.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 1204182..e0743e3 100644 --- a/index.html +++ b/index.html @@ -24,9 +24,20 @@ } function toggleExportConfig() { + (async () => { + let config = await window.api.localAppConfig(); + let code = document.getElementById("export-text"); + let text = JSON.stringify(config, null, 4); + let txt = document.createTextNode(text); + code.appendChild(txt); + })(); document.querySelector('.config-export').classList.toggle('hidden2'); } + function copyText() { + navigator.clipboard.writeText(text); + } +
@@ -116,17 +127,6 @@

Put this in your config.json file to include it installation-wi
-

From 07033df36b7ce50ed18c60134d70a47160afba85 Mon Sep 17 00:00:00 2001 From: OmegaRogue Date: Wed, 24 Jan 2024 23:00:34 +0100 Subject: [PATCH 3/3] :bug: Fix add game on clean install --- src/renderer.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer.ts b/src/renderer.ts index 210b514..53d9b23 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -37,6 +37,7 @@ document.querySelector("#add-game").addEventListener("click", async () => { if (!gameUrl || !gameName) return alert("Please enter a game name and url"); const newGameItem = {name: gameName, url: gameUrl, id: Math.round(Math.random() * 1000000)} as GameConfig; await updateGameList((appConfig) => { + appConfig.games = appConfig?.games ?? []; appConfig.games.push(newGameItem); }); gameUrlField.value = "";