From c05fdf59ad858d36859739b6c5beb1df6a7ff274 Mon Sep 17 00:00:00 2001 From: Aitorbp Date: Mon, 8 Apr 2024 08:25:56 +0100 Subject: [PATCH] fix: changed to "else if" --- .../data/files/repository/OCFileRepository.kt | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/owncloudData/src/main/java/com/owncloud/android/data/files/repository/OCFileRepository.kt b/owncloudData/src/main/java/com/owncloud/android/data/files/repository/OCFileRepository.kt index a76c1174ef0..e2249411a35 100644 --- a/owncloudData/src/main/java/com/owncloud/android/data/files/repository/OCFileRepository.kt +++ b/owncloudData/src/main/java/com/owncloud/android/data/files/repository/OCFileRepository.kt @@ -424,23 +424,21 @@ class OCFileRepository( if (remoteFolder.isAvailableOffline) AVAILABLE_OFFLINE_PARENT else NOT_AVAILABLE_OFFLINE }) - } else { - if (localChildToSync.etag != remoteChild.etag) { - // File exists in the database, we need to check several stuff. - folderContentUpdated.add( - remoteChild.apply { - copyLocalPropertiesFrom(localChildToSync) - // DO NOT update etag till contents are synced. - etag = localChildToSync.etag - needsToUpdateThumbnail = - (!remoteChild.isFolder && remoteChild.modificationTimestamp != localChildToSync.modificationTimestamp) || localChildToSync.needsToUpdateThumbnail - // Probably not needed, if the child was already in the database, the av offline status should be also there - if (remoteFolder.isAvailableOffline) { - availableOfflineStatus = AVAILABLE_OFFLINE_PARENT - } - // FIXME: What about renames? Need to fix storage path - }) - } + } else if (localChildToSync.etag != remoteChild.etag) { + // File exists in the database, we need to check several stuff. + folderContentUpdated.add( + remoteChild.apply { + copyLocalPropertiesFrom(localChildToSync) + // DO NOT update etag till contents are synced. + etag = localChildToSync.etag + needsToUpdateThumbnail = + (!remoteChild.isFolder && remoteChild.modificationTimestamp != localChildToSync.modificationTimestamp) || localChildToSync.needsToUpdateThumbnail + // Probably not needed, if the child was already in the database, the av offline status should be also there + if (remoteFolder.isAvailableOffline) { + availableOfflineStatus = AVAILABLE_OFFLINE_PARENT + } + // FIXME: What about renames? Need to fix storage path + }) } }