diff --git a/STDatabase/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/database/controllers/TransferController.kt b/STDatabase/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/database/controllers/TransferController.kt index 5b4fea8a..2c7fdfff 100644 --- a/STDatabase/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/database/controllers/TransferController.kt +++ b/STDatabase/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/database/controllers/TransferController.kt @@ -199,7 +199,11 @@ class TransferController(private val realmProvider: RealmProvider) { null -> TRUE_PREDICATE else -> "${TransferDB.transferDirectionPropertyName} == '${transferDirection}'" } - return realm.query(directionFilterQuery).sort(TransferDB::createdDateTimestamp.name, Sort.DESCENDING) + return realm + .query(directionFilterQuery) + .sort(TransferDB::createdDateTimestamp.name, Sort.DESCENDING) + .sort(TransferDB::expiredDateTimestamp.name, Sort.DESCENDING) + .sort(TransferDB::downloadCounterCredit.name, Sort.DESCENDING) } } }