diff options
author | 0neGal <mail@0negal.com> | 2024-12-20 19:29:48 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2024-12-20 19:29:48 +0100 |
commit | 957e8a9ad0b7bfe33079ca2d6a5dc097fdc2daa9 (patch) | |
tree | efae3014e6a97207adbddbb2dbd4b52a7210056f /src/app/js/set_buttons.js | |
parent | ada511f0c2f86a0a28e9d2129a1ebdd1edb19f3d (diff) | |
download | Viper-957e8a9ad0b7bfe33079ca2d6a5dc097fdc2daa9.tar.gz Viper-957e8a9ad0b7bfe33079ca2d6a5dc097fdc2daa9.zip |
if offline close browser and disable some buttons
Diffstat (limited to 'src/app/js/set_buttons.js')
-rw-r--r-- | src/app/js/set_buttons.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/app/js/set_buttons.js b/src/app/js/set_buttons.js index 9cb9d3e..4a0e1b2 100644 --- a/src/app/js/set_buttons.js +++ b/src/app/js/set_buttons.js @@ -6,22 +6,24 @@ ipcRenderer.on("set-buttons", (_, state) => { // disables or enables certain buttons when for example // updating/installing Northstar. -module.exports = (state, enable_gamepath_btns) => { - playNsBtn.disabled = ! state; +module.exports = (state, enable_gamepath_btns, elements) => { + if (! elements) { + playNsBtn.disabled = ! state; + } let disable_array = (array) => { for (let i = 0; i < array.length; i++) { array[i].disabled = ! state; if (state) { - array[i].classList.remove("disabled") + array[i].classList.remove("disabled"); } else { - array[i].classList.add("disabled") + array[i].classList.add("disabled"); } } } - disable_array(document.querySelectorAll([ + disable_array(elements || document.querySelectorAll([ "#modsdiv .el button", ".disable-when-installing", ".playBtnContainer .playBtn", |