Change nightly button link to public install page after 60s

This commit is contained in:
Mikołaj Pich 2018-05-05 17:45:32 +02:00
parent de801a93aa
commit 3c4a077149

View file

@ -84,19 +84,17 @@
} }
); );
var nightly = function() {
addButtonInfo("https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/master/artifacts/app-debug-bitrise-signed.apk/info", "#nightly-button", "#nightly-version", addButtonInfo("https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/master/artifacts/app-debug-bitrise-signed.apk/info", "#nightly-button", "#nightly-version",
function(button, version, res) { function(button, version, res) {
var json = JSON.parse(res.responseText); var json = JSON.parse(res.responseText);
button.href = json.url; button.href = json.expiring_download_url;
version.innerHTML = "v" + json.latestVersionCode; version.innerHTML = "v" + json.build_number;
setTimeout(function() {
button.href = json.public_install_page_url;
}, 60 * 100);
} }
) )
};
nightly();
setInterval(nightly, 60 * 1000);
</script> </script>
</body> </body>
</html> </html>