_inited check on 2fa page load

This commit is contained in:
Kyle Spearrin 2019-06-10 10:45:22 -04:00
parent 5248df85ec
commit dca567b00d

View file

@ -13,6 +13,7 @@ namespace Bit.App.Pages
private readonly IMessagingService _messagingService; private readonly IMessagingService _messagingService;
private TwoFactorPageViewModel _vm; private TwoFactorPageViewModel _vm;
private bool _inited;
public TwoFactorPage() public TwoFactorPage()
{ {
@ -67,15 +68,20 @@ namespace Bit.App.Pages
} }
} }
}); });
await LoadOnAppearedAsync(_scrollView, true, () =>
if(!_inited)
{ {
_vm.Init(); _inited = true;
if(_vm.TotpMethod) await LoadOnAppearedAsync(_scrollView, true, () =>
{ {
RequestFocus(_totpEntry); _vm.Init();
} if(_vm.TotpMethod)
return Task.FromResult(0); {
}); RequestFocus(_totpEntry);
}
return Task.FromResult(0);
});
}
} }
protected override void OnDisappearing() protected override void OnDisappearing()