Merge pull request #2511 from dpalou/MOBILE-3533

MOBILE-3533 messages: Don't show preferences if messaging disabled
main
Juan Leyva 2020-09-09 16:35:13 +02:00 committed by GitHub
commit cdb885f25c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -32,8 +32,10 @@ export class AddonMessagesSettingsHandler implements CoreSettingsHandler {
*
* @return Whether or not the handler is enabled on a site level.
*/
isEnabled(): boolean | Promise<boolean> {
return this.messagesProvider.isMessagePreferencesEnabled();
async isEnabled(): Promise<boolean> {
const messagingEnabled = await this.messagesProvider.isPluginEnabled();
return messagingEnabled && this.messagesProvider.isMessagePreferencesEnabled();
}
/**