1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-16 08:13:20 +00:00

Account switching

This commit is contained in:
Matt Portune
2022-01-16 22:43:37 -05:00
parent 86397a6f1e
commit ebae2585f6
129 changed files with 3883 additions and 1265 deletions

View File

@@ -7,12 +7,8 @@ namespace Bit.App.Pages
{
public class ExtensionPageViewModel : BaseViewModel
{
private const string StartedKey = "appExtensionStarted";
private const string ActivatedKey = "appExtensionActivated";
private readonly IMessagingService _messagingService;
private readonly IStorageService _storageService;
private readonly IPlatformUtilsService _platformUtilsService;
private readonly IStateService _stateService;
private bool _started;
private bool _activated;
@@ -20,8 +16,7 @@ namespace Bit.App.Pages
public ExtensionPageViewModel()
{
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
_storageService = ServiceContainer.Resolve<IStorageService>("storageService");
_platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
_stateService = ServiceContainer.Resolve<IStateService>("stateService");
PageTitle = AppResources.AppExtension;
}
@@ -52,8 +47,8 @@ namespace Bit.App.Pages
public async Task InitAsync()
{
var started = await _storageService.GetAsync<bool?>(StartedKey);
var activated = await _storageService.GetAsync<bool?>(ActivatedKey);
var started = await _stateService.GetAppExtensionStartedAsync();
var activated = await _stateService.GetAppExtensionActivatedAsync();
Started = started.GetValueOrDefault();
Activated = activated.GetValueOrDefault();
}