UNPKG

1.2 kBJavaScriptView Raw
1export function checkReady() {
2 if (typeof process === 'undefined') {
3 var win_1 = typeof window !== 'undefined' ? window : {};
4 var DEVICE_READY_TIMEOUT_1 = 5000;
5 // To help developers using cordova, we listen for the device ready event and
6 // log an error if it didn't fire in a reasonable amount of time. Generally,
7 // when this happens, developers should remove and reinstall plugins, since
8 // an inconsistent plugin is often the culprit.
9 var before_1 = Date.now();
10 var didFireReady_1 = false;
11 win_1.document.addEventListener('deviceready', function () {
12 console.log("Ionic Native: deviceready event fired after " + (Date.now() - before_1) + " ms");
13 didFireReady_1 = true;
14 });
15 setTimeout(function () {
16 if (!didFireReady_1 && win_1.cordova) {
17 console.warn("Ionic Native: deviceready did not fire within " + DEVICE_READY_TIMEOUT_1 + "ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.");
18 }
19 }, DEVICE_READY_TIMEOUT_1);
20 }
21}
22//# sourceMappingURL=bootstrap.js.map
\No newline at end of file