diff --git a/lib/extensions/admin/login/js/app.js b/lib/extensions/admin/login/js/app.js
index 5655505..f8f29ab 100644
--- a/lib/extensions/admin/login/js/app.js
+++ b/lib/extensions/admin/login/js/app.js
@@ -13,9 +13,21 @@ function checkStatus() {
}).then(function (resp) {
return resp.json().then(function (data) {
console.log(data);
+ if ('invalid' === data.status) {
+ window.alert("something went wrong");
+ return;
+ }
+ if ('complete' === data.status) {
+ setTimeout(function () {
+ window.document.body.innerHTML += ('
');
+ // TODO once this is loaded (even error) Let's Encrypt is done,
+ // then it's time to redirect to the domain. Yay!
+ }, 1 * 1000);
+ return;
+ }
+ setTimeout(checkStatus, 2 * 1000);
}, function (err) {
console.error(err);
- }).then(function () {
setTimeout(checkStatus, 2 * 1000);
});
});
@@ -40,18 +52,7 @@ function submitCode(pair) {
// TODO check for error (i.e. bad Pair Code / PIN)
// shouldn't be pending (because we get here by being ready)
// should poll over 'ready'
- if ('invalid' === data.status) {
- window.alert("something went wrong");
- return;
- }
- if ('complete' === data.status) {
- setTimeout(function () {
- window.document.body.innerHTML += ('
');
- // TODO once this is loaded (even error) Let's Encrypt is done,
- // then it's time to redirect to the domain. Yay!
- }, 1 * 1000);
- return;
- }
+
setTimeout(checkStatus, 0);