mirror of
https://github.com/bitwarden/mobile
synced 2025-12-20 18:23:51 +00:00
moved locked sets to AppSettingsService
This commit is contained in:
@@ -2,18 +2,17 @@ using System;
|
||||
using Bit.iOS.Extension.Models;
|
||||
using UIKit;
|
||||
using XLabs.Ioc;
|
||||
using Plugin.Settings.Abstractions;
|
||||
using Plugin.Fingerprint.Abstractions;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.App;
|
||||
using Bit.iOS.Core.Controllers;
|
||||
using Bit.App.Resources;
|
||||
using Bit.App.Abstractions;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
{
|
||||
public partial class LockFingerprintViewController : ExtendedUIViewController
|
||||
{
|
||||
private ISettings _settings;
|
||||
private IAppSettingsService _appSettingsService;
|
||||
private IFingerprint _fingerprint;
|
||||
|
||||
public LockFingerprintViewController(IntPtr handle) : base(handle)
|
||||
@@ -31,7 +30,7 @@ namespace Bit.iOS.Extension
|
||||
|
||||
public override void ViewDidLoad()
|
||||
{
|
||||
_settings = Resolver.Resolve<ISettings>();
|
||||
_appSettingsService = Resolver.Resolve<IAppSettingsService>();
|
||||
_fingerprint = Resolver.Resolve<IFingerprint>();
|
||||
|
||||
NavItem.Title = AppResources.VerifyFingerprint;
|
||||
@@ -74,7 +73,7 @@ namespace Bit.iOS.Extension
|
||||
var result = await _fingerprint.AuthenticateAsync(AppResources.FingerprintDirection);
|
||||
if(result.Authenticated)
|
||||
{
|
||||
_settings.AddOrUpdateValue(Constants.Locked, false);
|
||||
_appSettingsService.Locked = false;
|
||||
LoadingController.DismissLockAndContinue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,21 +2,19 @@ using System;
|
||||
using Bit.iOS.Extension.Models;
|
||||
using UIKit;
|
||||
using XLabs.Ioc;
|
||||
using Plugin.Settings.Abstractions;
|
||||
using Foundation;
|
||||
using Bit.iOS.Core.Views;
|
||||
using Bit.App.Resources;
|
||||
using Bit.iOS.Core.Utilities;
|
||||
using Bit.App.Abstractions;
|
||||
using System.Linq;
|
||||
using Bit.App;
|
||||
using Bit.iOS.Core.Controllers;
|
||||
|
||||
namespace Bit.iOS.Extension
|
||||
{
|
||||
public partial class LockPasswordViewController : ExtendedUITableViewController
|
||||
{
|
||||
private ISettings _settings;
|
||||
private IAppSettingsService _appSettingsService;
|
||||
private IAuthService _authService;
|
||||
private ICryptoService _cryptoService;
|
||||
|
||||
@@ -37,7 +35,7 @@ namespace Bit.iOS.Extension
|
||||
|
||||
public override void ViewDidLoad()
|
||||
{
|
||||
_settings = Resolver.Resolve<ISettings>();
|
||||
_appSettingsService = Resolver.Resolve<IAppSettingsService>();
|
||||
_authService = Resolver.Resolve<IAuthService>();
|
||||
_cryptoService = Resolver.Resolve<ICryptoService>();
|
||||
|
||||
@@ -88,7 +86,7 @@ namespace Bit.iOS.Extension
|
||||
var key = _cryptoService.MakeKeyFromPassword(MasterPasswordCell.TextField.Text, _authService.Email);
|
||||
if(key.Key.SequenceEqual(_cryptoService.Key.Key))
|
||||
{
|
||||
_settings.AddOrUpdateValue(Constants.Locked, false);
|
||||
_appSettingsService.Locked = false;
|
||||
MasterPasswordCell.TextField.ResignFirstResponder();
|
||||
LoadingController.DismissLockAndContinue();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Bit.iOS.Extension
|
||||
{
|
||||
public partial class LockPinViewController : ExtendedUIViewController
|
||||
{
|
||||
private ISettings _settings;
|
||||
private IAppSettingsService _appSettingsService;
|
||||
private IAuthService _authService;
|
||||
|
||||
public LockPinViewController(IntPtr handle) : base(handle)
|
||||
@@ -32,7 +32,7 @@ namespace Bit.iOS.Extension
|
||||
|
||||
public override void ViewDidLoad()
|
||||
{
|
||||
_settings = Resolver.Resolve<ISettings>();
|
||||
_appSettingsService = Resolver.Resolve<IAppSettingsService>();
|
||||
_authService = Resolver.Resolve<IAuthService>();
|
||||
|
||||
NavItem.Title = AppResources.VerifyPIN;
|
||||
@@ -68,7 +68,7 @@ namespace Bit.iOS.Extension
|
||||
if(PinTextField.Text == _authService.PIN)
|
||||
{
|
||||
Debug.WriteLine("BW Log, Start Dismiss PIN controller.");
|
||||
_settings.AddOrUpdateValue(Constants.Locked, false);
|
||||
_appSettingsService.Locked = false;
|
||||
PinTextField.ResignFirstResponder();
|
||||
LoadingController.DismissLockAndContinue();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user