From 37edfffb97bbc4b1f8e1b23d437f50b77c5ae284 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 16 Jul 2018 10:17:05 -0400 Subject: [PATCH] move last launch check after _lastQueriedUri --- src/Android/AutofillActivity.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Android/AutofillActivity.cs b/src/Android/AutofillActivity.cs index 92e090ce7..fac004836 100644 --- a/src/Android/AutofillActivity.cs +++ b/src/Android/AutofillActivity.cs @@ -10,8 +10,6 @@ namespace Bit.Android [Activity(Theme = "@style/BitwardenTheme.Splash", WindowSoftInputMode = SoftInput.StateHidden)] public class AutofillActivity : Activity { - private static TimeSpan _retrySpan = TimeSpan.FromSeconds(2); - private DateTime? _lastLaunch = null; private string _lastQueriedUri; @@ -87,13 +85,6 @@ namespace Bit.Android private void LaunchMainActivity(Intent callingIntent, int requestCode) { - var now = DateTime.UtcNow; - if(_lastLaunch.HasValue && (now - _lastLaunch.Value <= _retrySpan)) - { - return; - } - - _lastLaunch = now; _lastQueriedUri = callingIntent?.GetStringExtra("uri"); if(_lastQueriedUri == null) { @@ -101,6 +92,13 @@ namespace Bit.Android return; } + var now = DateTime.UtcNow; + if(_lastLaunch.HasValue && (now - _lastLaunch.Value <= TimeSpan.FromSeconds(2))) + { + return; + } + + _lastLaunch = now; var intent = new Intent(this, typeof(MainActivity)); if(!callingIntent.Flags.HasFlag(ActivityFlags.LaunchedFromHistory)) {