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