1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-11 05:43:30 +00:00

run subscribed messages on main thread

This commit is contained in:
Kyle Spearrin
2019-05-30 11:40:33 -04:00
parent 70fa41ca3e
commit c3b9f4e5a8
6 changed files with 41 additions and 25 deletions

View File

@@ -46,14 +46,17 @@ namespace Bit.App.Pages
protected async override void OnAppearing()
{
base.OnAppearing();
_broadcasterService.Subscribe(nameof(TwoFactorPage), async (message) =>
_broadcasterService.Subscribe(nameof(TwoFactorPage), (message) =>
{
if(message.Command == "gotYubiKeyOTP")
{
if(_vm.YubikeyMethod)
{
_vm.Token = (string)message.Data;
await _vm.SubmitAsync();
Device.BeginInvokeOnMainThread(async () =>
{
_vm.Token = (string)message.Data;
await _vm.SubmitAsync();
});
}
}
else if(message.Command == "resumeYubiKey")