1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-17 08:43:21 +00:00

Added "first load" check on site list to wait for sync to complete if key changed. Renamed "other" constants.

This commit is contained in:
Kyle Spearrin
2016-08-05 23:58:31 -04:00
parent d96a94b478
commit 38184e4893
18 changed files with 54 additions and 26 deletions

View File

@@ -160,14 +160,14 @@ namespace Bit.App.Services
return false;
}
_settings.AddOrUpdateValue(Constants.SettingLastSync, now);
_settings.AddOrUpdateValue(Constants.LastSync, now);
SyncCompleted(true);
return true;
}
public async Task<bool> IncrementalSyncAsync(TimeSpan syncThreshold)
{
DateTime? lastSync = _settings.GetValueOrDefault<DateTime?>(Constants.SettingLastSync);
DateTime? lastSync = _settings.GetValueOrDefault<DateTime?>(Constants.LastSync);
if(lastSync != null && DateTime.UtcNow - lastSync.Value < syncThreshold)
{
return false;
@@ -184,7 +184,7 @@ namespace Bit.App.Services
}
var now = DateTime.UtcNow;
DateTime? lastSync = _settings.GetValueOrDefault<DateTime?>(Constants.SettingLastSync);
DateTime? lastSync = _settings.GetValueOrDefault<DateTime?>(Constants.LastSync);
if(lastSync == null)
{
return await FullSyncAsync();
@@ -217,7 +217,7 @@ namespace Bit.App.Services
return false;
}
_settings.AddOrUpdateValue(Constants.SettingLastSync, now);
_settings.AddOrUpdateValue(Constants.LastSync, now);
SyncCompleted(true);
return true;
}