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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user