Merge pull request #2127 from dpalou/MOBILE-3026

MOBILE-3026 core: Fix plugin_not_installed error in iOS
main
Juan Leyva 2019-10-15 15:27:05 +02:00 committed by GitHub
commit 7a17bc7fee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 12 deletions

View File

@ -110,19 +110,21 @@ export class MoodleMobileApp implements OnInit {
this.loginHelper.sitePolicyNotAgreed(data.siteId);
});
// Refresh online status when changes.
this.network.onchange().subscribe(() => {
// Execute the callback in the Angular zone, so change detection doesn't stop working.
this.zone.run(() => {
const isOnline = this.appProvider.isOnline();
document.body.classList.toggle('core-offline', !isOnline);
document.body.classList.toggle('core-online', isOnline);
this.platform.ready().then(() => {
// Refresh online status when changes.
this.network.onchange().subscribe(() => {
// Execute the callback in the Angular zone, so change detection doesn't stop working.
this.zone.run(() => {
const isOnline = this.appProvider.isOnline();
document.body.classList.toggle('core-offline', !isOnline);
document.body.classList.toggle('core-online', isOnline);
if (isOnline) {
setTimeout(() => {
document.body.classList.remove('core-online');
}, 3000);
}
if (isOnline) {
setTimeout(() => {
document.body.classList.remove('core-online');
}, 3000);
}
});
});
});