Skip to content

Commit

Permalink
Merge pull request #21 from OmegaRogue/pull-request-no-injection
Browse files Browse the repository at this point in the history
1.5.4
  • Loading branch information
theripper93 committed Jan 24, 2024
2 parents e056cdc + b92cb08 commit 525a297
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
22 changes: 11 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,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);
}

</script>
<div class="content">
<div class="button-controls">
Expand Down Expand Up @@ -112,17 +123,6 @@ <h3>Put this in your <code>config.json</code> file to include it installation-wi
<pre><code id="export-text"></code></pre>
<button onclick="copyText()">Copy</button>
<button onclick="toggleExportConfig()">Close</button>
<script>
const config = await window.api.localAppConfig();
code = document.getElementById("export-text");
const text = JSON.stringify(config, null, 4);
txt = document.createTextNode(text);
code.appendChild(txt);

function copyText() {
navigator.clipboard.writeText(text);
}
</script>
</div>
</section>

Expand Down
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ getAppConfig();

/* 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 {
Expand Down
1 change: 1 addition & 0 deletions src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down

0 comments on commit 525a297

Please sign in to comment.