Skip to content

Commit

Permalink
MOBILE-4367 courses: Check if core_my_view_page is available
Browse files Browse the repository at this point in the history
Otherwise an error is displayed in console when trying to use the WS
  • Loading branch information
dpalou committed Aug 21, 2023
1 parent 813f731 commit 4e27bb6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/features/courses/services/courses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,10 @@ export class CoreCoursesProvider {
*/
async logView(page: 'my' | 'dashboard'): Promise<void> {
const site = CoreSites.getRequiredCurrentSite();
if (!site.wsAvailable('core_my_view_page')) {
return;
}

const params: CoreMyViewPageWSParams = { page };

await site.write('core_my_view_page', params);
Expand Down

0 comments on commit 4e27bb6

Please sign in to comment.