Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Fix previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
themoonisacheese committed Apr 17, 2021
1 parent 80b643b commit 81f62f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ function join() {
let positioninqueue = "None";
try{
positioninqueue = headermessage.text.split("\n")[5].substring(25);
}catch(TypeError e){
console.log("Reading position in queue from tab failed! Is the queue empty, or the server isn't 2b2t?");
}catch(e){
if (e instanceof TypeError)
console.log("Reading position in queue from tab failed! Is the queue empty, or the server isn't 2b2t?");
}
if(positioninqueue !== "None") positioninqueue = Number(positioninqueue);
webserver.queuePlace = positioninqueue; // update info on the web page
Expand Down

2 comments on commit 81f62f3

@czho
Copy link

@czho czho commented on 81f62f3 Apr 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if q is 0 this will spam console, maby set position in q to finished

@themoonisacheese
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if q is 0 this will spam console, maby set position in q to finished

It won't, because if q is 0 isqueuefinished will get set to true as soon as the client connects.

Even if not, tab updates are sent every 5 seconds by 2b2t, which while spammy is very much manageable.

Please sign in to comment.