Browse Source

Don't fail loading pages when their JS comes after pageAfterIn fires

master
Skylar Ittner 7 months ago
parent
commit
0acab8e789
1 changed files with 32 additions and 4 deletions
  1. 32
    4
      www/routes.js

+ 32
- 4
www/routes.js View File

@@ -19,7 +19,14 @@ var routes = [
},
on: {
pageAfterIn: function () {
loadHomePage(function () {});
function tryToLoadHomePage() {
if (typeof loadHomePage != "function") {
setTimeout(tryToLoadHomePage, 500);
} else {
loadHomePage(function () {});
}
}
tryToLoadHomePage();
}
}
},
@@ -39,7 +46,14 @@ var routes = [
name: 'sendmoney',
on: {
pageAfterIn: function () {
loadSendMoneyPage();
function tryToLoadSendMoneyPage() {
if (typeof loadSendMoneyPage != "function") {
setTimeout(tryToLoadSendMoneyPage, 500);
} else {
loadSendMoneyPage();
}
}
tryToLoadSendMoneyPage();
}
}
},
@@ -54,7 +68,14 @@ var routes = [
name: 'addfunds',
on: {
pageAfterIn: function () {
initPaymentPage();
function tryToInitPaymentPage() {
if (typeof initPaymentPage != "function") {
setTimeout(tryToInitPaymentPage, 500);
} else {
initPaymentPage();
}
}
tryToInitPaymentPage();
}
}
},
@@ -69,7 +90,14 @@ var routes = [
name: 'updateprofile',
on: {
pageAfterIn: function () {
loadProfilePage();
function tryToLoadProfilePage() {
if (typeof loadProfilePage != "function") {
setTimeout(tryToLoadProfilePage, 500);
} else {
loadProfilePage();
}
}
tryToLoadProfilePage();
}
}
},

Loading…
Cancel
Save