MOBILE-4616 reportbuilder: Only show report builder on user menu

main
Pau Ferrer Ocaña 2024-10-15 11:11:18 +02:00
parent cfff5e6217
commit c6f73af200
1 changed files with 13 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import {
CoreUserProfileHandlerType,
CoreUserProfileHandler,
CoreUserProfileHandlerData,
CoreUserDelegateContext,
} from '@features/user/services/user-delegate';
import { CoreNavigator } from '@services/navigator';
import { makeSingleton } from '@singletons';
@ -42,6 +43,18 @@ export class CoreReportBuilderHandlerService implements CoreUserProfileHandler {
return await CoreReportBuilder.isEnabled();
}
/**
* @inheritdoc
*/
async isEnabledForContext(context: CoreUserDelegateContext): Promise<boolean> {
// Custom reports only available in user menu.
if (context !== CoreUserDelegateContext.USER_MENU) {
return false;
}
return this.isEnabled();
}
/**
* @inheritdoc
*/