Skip to content

Commit

Permalink
MOBILE-4616 reportbuilder: Only show report builder on user menu
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyserver committed Oct 15, 2024
1 parent cfff5e6 commit c6f73af
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/core/features/reportbuilder/services/handlers/reportbuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
CoreUserProfileHandlerType,
CoreUserProfileHandler,
CoreUserProfileHandlerData,
CoreUserDelegateContext,
} from '@features/user/services/user-delegate';
import { CoreNavigator } from '@services/navigator';
import { makeSingleton } from '@singletons';
Expand All @@ -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
*/
Expand Down

0 comments on commit c6f73af

Please sign in to comment.