mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-02 00:07:23 +08:00
refactor(): applied new lint rules
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import * as _ from 'lodash';
|
||||
|
||||
export function checkReady() {
|
||||
const DEVICE_READY_TIMEOUT = 5000;
|
||||
|
||||
@@ -9,13 +11,17 @@ export function checkReady() {
|
||||
|
||||
let didFireReady = false;
|
||||
document.addEventListener('deviceready', () => {
|
||||
console.log(`Ionic Native: deviceready event fired after ${(Date.now() - before)} ms`);
|
||||
console.log(
|
||||
`Ionic Native: deviceready event fired after ${Date.now() - before} ms`
|
||||
);
|
||||
didFireReady = true;
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
if (!didFireReady && !!window.cordova) {
|
||||
console.warn(`Ionic 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.`);
|
||||
if (!didFireReady && !_.isUndefined(window.cordova)) {
|
||||
console.warn(
|
||||
`Ionic 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user