bootstrap.js 1.2 KB

12345678910111213141516171819202122232425
  1. /**
  2. *
  3. */
  4. export function checkReady() {
  5. if (typeof process === 'undefined') {
  6. var win_1 = typeof window !== 'undefined' ? window : {};
  7. var DEVICE_READY_TIMEOUT_1 = 5000;
  8. // To help developers using cordova, we listen for the device ready event and
  9. // log an error if it didn't fire in a reasonable amount of time. Generally,
  10. // when this happens, developers should remove and reinstall plugins, since
  11. // an inconsistent plugin is often the culprit.
  12. var before_1 = Date.now();
  13. var didFireReady_1 = false;
  14. win_1.document.addEventListener('deviceready', function () {
  15. console.log("Ionic Native: deviceready event fired after " + (Date.now() - before_1) + " ms");
  16. didFireReady_1 = true;
  17. });
  18. setTimeout(function () {
  19. if (!didFireReady_1 && win_1.cordova) {
  20. 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.");
  21. }
  22. }, DEVICE_READY_TIMEOUT_1);
  23. }
  24. }
  25. //# sourceMappingURL=bootstrap.js.map