Skip to content

Commit

Permalink
Small fix for heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
exsandebest committed Jan 20, 2020
1 parent 22e8fa2 commit d619d1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions public/js/pages/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ function subscribe() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "/subscribe", true);
xhr.onload = () => {
if (xhr.status === 503){
subscribe();
return;
}
var r = JSON.parse(xhr.responseText);
if (r.type === "message") {
var str = `<span class="msgText" idx="${r.id}"><a class="login" href="/u/${r.login}"><b style="color: ${r.color};">${r.login}</b></a>: <msg id = "msg${r.id}"></msg><span class="messageTime">${r.time}</span></span><br>`;
Expand Down

0 comments on commit d619d1a

Please sign in to comment.