Github pages live server not shutting down properly. #137349
Replies: 2 comments 1 reply
-
I think it is issue with your code. Firstly your are prompting for the time input which is fine. Now when the time runs out and game is over, you are clearing the score but not the time stored in the session storage due to which on next reload or try, it is not prompting to enter a time but is continuing from the time that is still in the session storage. The fix for this would be to check if the time is less than or 0 also along with undefined. if (sessionStorage.getItem('time') == undefined || Number(sessionStorage.getItem('time'))<=0) {
set_timer()
} else {
time_elem.innerHTML = `You have <b>${sessionStorage.getItem('time')}</b> seconds left.`
} I converted the time to Number ensuring correct comparison. |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
Hi all,
Github pages is acting weirdly for me. I am new to using it.
I have created a respiratory and have created a live server on github for people to use. But when I close out of the live server and open it up again, the live server doesn't seem to be 'shutting down', and it just ends up acting weirdly.
Like, I have added a timer to my website. When I open the live server manually (by not pasting in a link), the timer seems to be working fine. But when I click on the link to my live server, or refresh the page, the timer is going into the negatives, and I don't think that is a problem with the code. I have tested the game again and again and there was never any problem. I think that my live server isn't shutting down properly.
Here is the link to my repo: https://github.com/GraffitiTheWall/word-scramble.
Any help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions