MOBILE-4367 courses: Check if core_my_view_page is available

Otherwise an error is displayed in console when trying to use the WS
main
Dani Palou 2023-08-21 09:01:15 +02:00
parent 813f731fa9
commit 4e27bb639d
1 changed files with 4 additions and 0 deletions

View File

@ -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);