diff --git a/public/assets/js/socket.js b/public/assets/js/socket.js index 5f9a8db..4755bb7 100644 --- a/public/assets/js/socket.js +++ b/public/assets/js/socket.js @@ -24,7 +24,6 @@ var nickname; var myProfile; socket.emit("my profile", (profile) => { - console.log(profile); // General profile data let options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; $("#playerSince").html(new Date(profile.profile.account_creation).toLocaleDateString("pl-PL", options)); @@ -35,6 +34,7 @@ socket.emit("my profile", (profile) => { $("#totalPlayed").html(profile.stats.alltime_matches); $("#winrate").html(`${profile.stats.winrate}%`); + // Match history var matchHistory = profile.matchHistory; var matchHistoryDOM = ""; @@ -43,8 +43,6 @@ socket.emit("my profile", (profile) => { for (let i = 0; i < matchHistory.length; i++) { const match = matchHistory[i]; - console.log(); - let date = new Date(match.date).toLocaleDateString("pl-PL", options); const minutes = Math.floor(match.duration / 60).toLocaleString('pl-PL', { minimumIntegerDigits: 2, useGrouping: false }); diff --git a/public/assets/js/spa_lib.js b/public/assets/js/spa_lib.js index d0fb62b..7630a40 100644 --- a/public/assets/js/spa_lib.js +++ b/public/assets/js/spa_lib.js @@ -2,20 +2,22 @@ var activeView; var returnLock = false; function switchView(viewContainerId, useReplaceState=false) { - $(`.container`).css({ opacity: 0, animation: "OutAnim 0.2s 1 ease" }); - setTimeout(() => { - $(`.container`).css("display", "none"); - $(`.container#${viewContainerId}`).css({ display: "flex", opacity: 1, animation: "InAnim 0.2s 1 ease" }); - let path = $(`.container#${viewContainerId}`).data("path"); - let title = $(`.container#${viewContainerId}`).data("title"); - if (useReplaceState) { - history.replaceState(null, "", path ? path : "/"); - } else { - history.pushState(null, title ? title : "Statki", path ? path : "/"); - } + if (!returnLock) { + $(`.container`).css({ opacity: 0, animation: "OutAnim 0.2s 1 ease" }); + setTimeout(() => { + $(`.container`).css("display", "none"); + $(`.container#${viewContainerId}`).css({ display: "flex", opacity: 1, animation: "InAnim 0.2s 1 ease" }); + let path = $(`.container#${viewContainerId}`).data("path"); + let title = $(`.container#${viewContainerId}`).data("title"); + if (useReplaceState) { + history.replaceState(null, "", path ? path : "/"); + } else { + history.pushState(null, title ? title : "Statki", path ? path : "/"); + } - activeView = viewContainerId; - }, 200); + activeView = viewContainerId; + }, 200); + } } function lockUI(doLock) {