From 506ab12b955bbf27f94b0a44690456bfc5e159be Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 3 Jun 2019 23:26:57 -0400 Subject: [PATCH] sync on migrate if online --- src/App/Migration/MigrationHelpers.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/App/Migration/MigrationHelpers.cs b/src/App/Migration/MigrationHelpers.cs index 31a8f6ed5..0e7783ebf 100644 --- a/src/App/Migration/MigrationHelpers.cs +++ b/src/App/Migration/MigrationHelpers.cs @@ -84,7 +84,7 @@ namespace Bit.App.Migration var oldFingerprint = settingsShim.GetValueOrDefault("setting:fingerprintUnlockOn", false); // Save settings - + await storageService.SaveAsync(Constants.AccessibilityAutofillPersistNotificationKey, settingsShim.GetValueOrDefault("setting:persistNotification", false)); await storageService.SaveAsync(Constants.AccessibilityAutofillPasswordFieldKey, @@ -175,7 +175,7 @@ namespace Bit.App.Migration var pinProtectedKey = await cryptoService.EncryptAsync(oldKeyBytes, pinKey); await storageService.SaveAsync(Constants.PinProtectedKey, pinProtectedKey.EncryptedString); } - + // Post migration tasks await cryptoService.ToggleKeyAsync(); await storageService.SaveAsync(Constants.LastActiveKey, DateTime.UtcNow.AddYears(-1)); @@ -185,8 +185,10 @@ namespace Bit.App.Migration settingsShim.Remove(Constants.OldUserIdKey); Migrating = false; messagingService.Send("migrated"); - var task = Task.Run(() => syncService.FullSyncAsync(true)); - + if(Xamarin.Essentials.Connectivity.NetworkAccess != Xamarin.Essentials.NetworkAccess.None) + { + var task = Task.Run(() => syncService.FullSyncAsync(true)); + } return true; } }