1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-14 07:13:33 +00:00

Use UserService to manage emailVerified (#1367)

This commit is contained in:
Thomas Rittson
2021-04-15 14:54:58 +10:00
committed by GitHub
parent 75e27ffbe3
commit 3b2b37b3b0
4 changed files with 21 additions and 3 deletions

View File

@@ -21,7 +21,6 @@ namespace Bit.App.Pages
private readonly IMessagingService _messagingService;
private readonly IUserService _userService;
private readonly ISendService _sendService;
private readonly ITokenService _tokenService;
private bool _sendEnabled;
private bool _canAccessPremium;
private bool _emailVerified;
@@ -55,7 +54,6 @@ namespace Bit.App.Pages
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
_userService = ServiceContainer.Resolve<IUserService>("userService");
_sendService = ServiceContainer.Resolve<ISendService>("sendService");
_tokenService = ServiceContainer.Resolve<ITokenService>("tokenService");
TogglePasswordCommand = new Command(TogglePassword);
TypeOptions = new List<KeyValuePair<string, SendType>>
@@ -224,7 +222,7 @@ namespace Bit.App.Pages
{
PageTitle = EditMode ? AppResources.EditSend : AppResources.AddSend;
_canAccessPremium = await _userService.CanAccessPremiumAsync();
_emailVerified = _tokenService.GetEmailVerified();
_emailVerified = await _userService.GetEmailVerifiedAsync();
SendEnabled = ! await AppHelpers.IsSendDisabledByPolicyAsync();
DisableHideEmail = await AppHelpers.IsHideEmailDisabledByPolicyAsync();
SendOptionsPolicyInEffect = SendEnabled && DisableHideEmail;