1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-05 23:53:33 +00:00

Further simplify SyncService code

This commit is contained in:
Bernd Schoolmann
2023-08-03 19:40:53 +02:00
parent ed75aa7942
commit cd45992e6b

View File

@@ -277,17 +277,18 @@ namespace Bit.Core.Services
public async Task<bool> SyncUpsertSendAsync(SyncSendNotification notification, bool isEdit)
{
SyncStarted();
if (!await _stateService.IsAuthenticatedAsync()) return SyncCompleted(false);
if (!await _stateService.IsAuthenticatedAsync())
{
return SyncCompleted(false);
}
try
{
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);