diff --git a/Project/static/game.html b/Project/static/game.html index f04fb363900fa7b93058ec62b1f17410958c125d..eb981e804431cd0535e4d270ddd479d2a5cf78d9 100644 --- a/Project/static/game.html +++ b/Project/static/game.html @@ -36,7 +36,7 @@ <!--This is probably js instead of a list with links--> <ul> <li><a id="gamesButton" href="/games">Games</a> </li> - <li><a id="gameButton" href="#">Game</a></li> + <li><a id="gameButton" href="">Game</a></li> <li><a id="forumButton" href="#">Forum</a></li> </ul> diff --git a/Project/static/js/game.js b/Project/static/js/game.js index f626388e5d50cdd3d3966f61e9ed2b2f07866c67..49a77690bbfff23f646b1d2589c40ef3e40f0b18 100644 --- a/Project/static/js/game.js +++ b/Project/static/js/game.js @@ -18,7 +18,6 @@ const eSubmitCommentButton = document.getElementById('submitComment'); const eComment = document.getElementById('comment'); const forumButton = document.getElementById('forumButton'); const sectionMain = document.getElementById('sectionMain'); -const gameButton = document.getElementById('gameButton'); const loginButton = document.getElementById('loginButton'); const userPageButton = document.getElementById('userPageButton'); @@ -132,7 +131,7 @@ function getUserGameData(token) { } //executing comments and reviews showReviews(); -showComments(); + forumButton.addEventListener('click', function (event) { @@ -166,16 +165,7 @@ forumButton.addEventListener('click', function (event) { showComments(); }); -gameButton.addEventListener('click', async (e) => { - e.preventDefault(); - sectionMain.innerHTML = ''; - getGameData(); - if (currentUser && currentUser.idToken) { - getUserGameData(currentUser.idToken); - } else { - console.error("User token is missing or invalid."); - } -}); + // Submit review and rating eFormButton.addEventListener('click', async (e) => {