mirror of
https://github.com/bitwarden/mobile
synced 2025-12-13 14:53:18 +00:00
Further simplify SyncService code
This commit is contained in:
@@ -277,17 +277,18 @@ namespace Bit.Core.Services
|
|||||||
public async Task<bool> SyncUpsertSendAsync(SyncSendNotification notification, bool isEdit)
|
public async Task<bool> SyncUpsertSendAsync(SyncSendNotification notification, bool isEdit)
|
||||||
{
|
{
|
||||||
SyncStarted();
|
SyncStarted();
|
||||||
if (!await _stateService.IsAuthenticatedAsync()) return SyncCompleted(false);
|
if (!await _stateService.IsAuthenticatedAsync())
|
||||||
|
{
|
||||||
|
return SyncCompleted(false);
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var localSend = await _sendService.GetAsync(notification.Id);
|
var localSend = await _sendService.GetAsync(notification.Id);
|
||||||
if (localSend != null && localSend.RevisionDate >= notification.RevisionDate)
|
if (localSend != null && localSend.RevisionDate >= notification.RevisionDate
|
||||||
|
&& ((isEdit && localSend == null) || (!isEdit && localSend != null)))
|
||||||
{
|
{
|
||||||
if ((isEdit && localSend == null) || (!isEdit && localSend != null))
|
return SyncCompleted(false);
|
||||||
{
|
|
||||||
return SyncCompleted(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var remoteSend = await _apiService.GetSendAsync(notification.Id);
|
var remoteSend = await _apiService.GetSendAsync(notification.Id);
|
||||||
|
|||||||
Reference in New Issue
Block a user