Device ready call

This commit is contained in:
Max Lynch
2015-11-29 16:30:15 -06:00
parent 3327fe8f45
commit 45dc983752
23 changed files with 150 additions and 14 deletions
+17
View File
@@ -1,3 +1,20 @@
const DEVICE_READY_TIMEOUT = 2000;
export * from './plugins/actionsheet';
export * from './plugins/camera';
export * from './plugins/statusbar';
export * from './plugins/toast';
declare var window;
let didFireReady = false;
window.addEventListener('deviceready', function() {
didFireReady = true;
})
setTimeout(function() {
if(!didFireReady && window.cordova) {
console.warn('Native: deviceready did not fire within ' + DEVICE_READY_TIMEOUT + 'ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.');
}
}, DEVICE_READY_TIMEOUT);