diff --git a/public/index.html b/public/index.html index 2bc20ed81..16fdcdf96 100644 --- a/public/index.html +++ b/public/index.html @@ -338,15 +338,13 @@ }); if (response.ok === true) { const getData = await response.json(); - is_colab = getData.is_colab; - if(is_colab != false){ - var currentUrl = window.location.href; - if (currentUrl.charAt(currentUrl.length - 1) === '/') { - currentUrl = currentUrl.substring(0, currentUrl.length - 1); - currentUrl+=':80808'; - } - $('#api_url_text').val(currentUrl); - $('#api_button').click(); + if(getData.colaburl != false){ + is_colab = true; + + $('#api_url_text').val(String(getData.colaburl).trim()); + setTimeout(function() { + $('#api_button').click(); + }, 3000); } diff --git a/server.js b/server.js index bf9baf6dc..bd753536b 100644 --- a/server.js +++ b/server.js @@ -503,10 +503,10 @@ app.post("/getbackgrounds", jsonParser, function(request, response){ }); app.post("/iscolab", jsonParser, function(request, response){ let send_data = false; - if(String(process.env.colaburl).trim() !== undefined){ + if(process.env.colaburl !== undefined){ send_data = String(process.env.colaburl).trim(); } - response.send({is_colab:send_data}); + response.send({colaburl:send_data}); }); app.post("/getuseravatars", jsonParser, function(request, response){