Skip to content

Commit

Permalink
fix config error
Browse files Browse the repository at this point in the history
  • Loading branch information
Escartem committed Apr 23, 2024
1 parent 69bdd12 commit 3727a40
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
9 changes: 9 additions & 0 deletions public/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,15 @@ function showPopup(title, content, width=80, height=70) {
}

window.addEventListener("load", () => {
// refresh ui
updateBg();
switchMode(getVar("gameMode"), false);
if (getVar("leftPanelEnabled") && (window.innerWidth > phoneWidth)) { switchLeftPanel() };
themeSwitch();
reportBtnSwitch();
switchNewTheme();
updateStats();
// load data
setupData(() => {
console.log("📈 done !")
switchMode(gameMode);
Expand Down
16 changes: 1 addition & 15 deletions public/assets/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ function updateBg() {
}
}

updateBg();

//////////////////////
//// RESET SCORES ////
//////////////////////
Expand Down Expand Up @@ -99,8 +97,6 @@ function switchMode(mode, initialize=true) {
updateBg();
}

switchMode(getVar("gameMode"), false);

////////////////////
//// LEFT PANEL ////
////////////////////
Expand Down Expand Up @@ -132,8 +128,6 @@ function switchLeftPanel() {
}
}

if (getVar("leftPanelEnabled") && (window.innerWidth > phoneWidth)) { switchLeftPanel() };

///////////////
//// THEME ////
///////////////
Expand All @@ -148,8 +142,6 @@ function themeSwitch() {
}
}

themeSwitch();

///////////////////////
//// REPORT BUTTON ////
///////////////////////
Expand All @@ -166,8 +158,6 @@ function reportBtnSwitch() {
}
}

reportBtnSwitch();

/////////////////////////
//// CHARACTERS LIST ////
/////////////////////////
Expand Down Expand Up @@ -290,8 +280,6 @@ function switchNewTheme() {
}
}

switchNewTheme();

//////////////////////
//// UPDATE STATS ////
//////////////////////
Expand All @@ -313,8 +301,6 @@ function updateStats() {
statsChar.innerHTML = charText
}

updateStats()

// update buttons state //
function buttonState(tf, b, mode) {
if (mode == "char") {
Expand Down Expand Up @@ -352,4 +338,4 @@ function showNotification(message) {
notifBtn.onclick = () => { notifBar.style.transform = "translateY(-100%)"; }

notifBar.style.transform = "translateY(0%)";
}
}
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@
</div>
<script src="./assets/js/elements.js?v=1.0"></script>
<script src="./assets/js/config.js?v=1.0"></script>
<script src="./assets/js/utils.js?v=1.0"></script>
<script src="./assets/js/app.js?v=2.7"></script>
<script src="./assets/js/utils.js?v=1.0:1"></script>
<script src="./assets/js/app.js?v=2.7:1"></script>
</body>
</html>

0 comments on commit 3727a40

Please sign in to comment.