Fix browsers that do not support Promises
This commit is contained in:
@@ -19,11 +19,23 @@
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
injectScriptElement(
|
||||
self.Promise ? "./libraries/alameda.js" : "./libraries/require.js",
|
||||
function() {
|
||||
// onload of require library
|
||||
injectScriptElement("./scripts/site.js");
|
||||
}
|
||||
);
|
||||
function loadSite() {
|
||||
injectScriptElement(
|
||||
"./libraries/alameda.js",
|
||||
function() {
|
||||
// onload of require library
|
||||
injectScriptElement("./scripts/site.js");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!self.Promise) {
|
||||
// Load Promise polyfill if they are not natively supported
|
||||
injectScriptElement(
|
||||
"./libraries/npo.js",
|
||||
loadSite
|
||||
);
|
||||
} else {
|
||||
loadSite();
|
||||
}
|
||||
})();
|
||||
|
||||
+1
-5
@@ -671,11 +671,7 @@ var AppInfo = {};
|
||||
AppInfo.isNativeApp = true;
|
||||
}
|
||||
|
||||
if (!window.Promise || browser.web0s) {
|
||||
require(["native-promise-only"], init);
|
||||
} else {
|
||||
init();
|
||||
}
|
||||
init();
|
||||
}
|
||||
|
||||
var localApiClient;
|
||||
|
||||
Reference in New Issue
Block a user