From 47e427a85116f469ead1dc05729f220a2f948052 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 31 Jan 2017 00:30:41 -0500 Subject: [PATCH] wip autofill tweaks --- src/App/App.cs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/App/App.cs b/src/App/App.cs index 463e83833..b68dff243 100644 --- a/src/App/App.cs +++ b/src/App/App.cs @@ -61,7 +61,6 @@ namespace Bit.App SetCulture(); SetStyles(); - WasFromAutofillService = !string.IsNullOrWhiteSpace(_uri); if(authService.IsAuthenticated && _uri != null) { MainPage = new ExtendedNavigationPage(new VaultAutofillListLoginsPage(_uri)); @@ -95,6 +94,7 @@ namespace Bit.App protected async override void OnStart() { // Handle when your app starts + ResumeFromAutofill(); await CheckLockAsync(false); _databaseService.CreateTables(); await Task.Run(() => FullSyncAsync()).ConfigureAwait(false); @@ -123,15 +123,10 @@ namespace Bit.App // Handle when your app resumes Debug.WriteLine("OnResume"); + ResumeFromAutofill(); if(Device.OS == TargetPlatform.Android) { - if(WasFromAutofillService) - { - WasFromAutofillService = false; - MainPage = new MainPage(); - - } await CheckLockAsync(false); } @@ -142,6 +137,19 @@ namespace Bit.App } } + private void ResumeFromAutofill() + { + if(Device.OS == TargetPlatform.Android && WasFromAutofillService) + { + WasFromAutofillService = false; + MainPage = new MainPage(); + } + else + { + WasFromAutofillService = !string.IsNullOrWhiteSpace(_uri); + } + } + private async Task IncrementalSyncAsync() { if(_connectivity.IsConnected)