Skip to content

Commit

Permalink
hotfix for disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
IUrreta committed Nov 14, 2024
1 parent ac85099 commit 7112800
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 2 additions & 0 deletions back/commands/saveSelected.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ async def overwrite_config_file(self, difficulty, triggerList, refurbish, frozen
data["triggerList"] = triggerList
data["refurbish"] = refurbish
data["mentalityFrozen"] = frozenMentality
if "disabled" in data:
del data["disabled"]
with open(file_path, "w") as json_file:
json.dump(data, json_file, indent=4)

Expand Down
14 changes: 2 additions & 12 deletions front/js/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1195,19 +1195,9 @@ document.addEventListener('DOMContentLoaded',function () {
manage_difficulty_warnings(difficulty_dict[parseInt(info["difficulty"])])
}
update_refurbish_span(info["refurbish"])
manage_disabled_list(info["disabled"])
}
}

function manage_disabled_list(disabled_list){
for (key in disabled_list){
let elem = document.getElementById(key)
if (disabled_list[key] === 1){
elem.classList.add("disabled")
}
}
}

document.querySelectorAll(".color-picker").forEach(function (elem) {
let reader = elem.parentNode.querySelector(".color-reader")
elem.addEventListener("input",function () {
Expand Down Expand Up @@ -1740,8 +1730,8 @@ document.addEventListener('DOMContentLoaded',function () {
let warn = document.getElementById(id)
let difName = difficulty_dict[triggerList[id]]
if (triggerList[id] !== -1) {
warn.className = difficultyConfig[difName][id].className
warn.textContent = difficultyConfig[difName][id].text
warn.className = difficultyConfig[difName][id].className
warn.textContent = difficultyConfig[difName][id].text
}
else{
warn.classList.add("disabled")
Expand Down

0 comments on commit 7112800

Please sign in to comment.