Skip to content

Commit

Permalink
Mobile app: Use CoreNetwork instead of deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dpalou committed Jul 22, 2024
1 parent 2a757ce commit c718c70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions mobile/js/latest/courseview.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ this.doRefresh = (done) => {
};

this.moduleName = this.TranslateService.instant('plugin.mod_choicegroup.modulename');
this.isOnline = this.CoreAppProvider.isOnline();
this.isOnline = this.CoreNetwork.isOnline();

// Refresh online status when changes.
const onlineObserver = this.Network.onChange().subscribe(() => {
this.isOnline = this.CoreAppProvider.isOnline();
const onlineObserver = this.CoreNetwork.onChange().subscribe(() => {
this.isOnline = this.CoreNetwork.isOnline();
});

let syncObserver;
Expand Down
6 changes: 3 additions & 3 deletions mobile/js/latest/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class AddonModChoiceGroupProvider {
});
};

if (!context.CoreAppProvider.isOnline() && allowOffline) {
if (!context.CoreNetwork.isOnline() && allowOffline) {
// App is offline, store the action.
return storeOffline();
}
Expand Down Expand Up @@ -284,7 +284,7 @@ class AddonModChoiceGroupProvider {
});
};

if (!context.CoreAppProvider.isOnline() && allowOffline) {
if (!context.CoreNetwork.isOnline() && allowOffline) {
// App is offline, store the action.
return storeOffline();
}
Expand Down Expand Up @@ -445,7 +445,7 @@ class AddonModChoiceGroupSyncProvider extends this.CoreSyncBaseProvider {
return;
}

if (!context.CoreAppProvider.isOnline()) {
if (!context.CoreNetwork.isOnline()) {
// Cannot sync in offline.
return Promise.reject(new context.CoreNetworkError());
}
Expand Down

0 comments on commit c718c70

Please sign in to comment.