From dca567b00da664f91058ccc27285c607d6fb7ed3 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 10 Jun 2019 10:45:22 -0400 Subject: [PATCH] _inited check on 2fa page load --- src/App/Pages/Accounts/TwoFactorPage.xaml.cs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/App/Pages/Accounts/TwoFactorPage.xaml.cs b/src/App/Pages/Accounts/TwoFactorPage.xaml.cs index c4719b7a8..1c3085490 100644 --- a/src/App/Pages/Accounts/TwoFactorPage.xaml.cs +++ b/src/App/Pages/Accounts/TwoFactorPage.xaml.cs @@ -13,6 +13,7 @@ namespace Bit.App.Pages private readonly IMessagingService _messagingService; private TwoFactorPageViewModel _vm; + private bool _inited; public TwoFactorPage() { @@ -67,15 +68,20 @@ namespace Bit.App.Pages } } }); - await LoadOnAppearedAsync(_scrollView, true, () => + + if(!_inited) { - _vm.Init(); - if(_vm.TotpMethod) + _inited = true; + await LoadOnAppearedAsync(_scrollView, true, () => { - RequestFocus(_totpEntry); - } - return Task.FromResult(0); - }); + _vm.Init(); + if(_vm.TotpMethod) + { + RequestFocus(_totpEntry); + } + return Task.FromResult(0); + }); + } } protected override void OnDisappearing()