From 4e5ed18d3d4f73e2b86de84c6f290b6b4a13e504 Mon Sep 17 00:00:00 2001 From: Pablo Date: Wed, 21 Feb 2024 15:13:49 +0100 Subject: [PATCH] fix code smells Signed-off-by: Pablo --- .../login/SyncIsPerformedInteractor.kt | 6 ++-- app/src/main/res/layout/activity_login.xml | 35 ------------------- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/app/src/main/java/org/dhis2/usescases/login/SyncIsPerformedInteractor.kt b/app/src/main/java/org/dhis2/usescases/login/SyncIsPerformedInteractor.kt index 0105c0e4b5..0b6cf42286 100644 --- a/app/src/main/java/org/dhis2/usescases/login/SyncIsPerformedInteractor.kt +++ b/app/src/main/java/org/dhis2/usescases/login/SyncIsPerformedInteractor.kt @@ -15,8 +15,10 @@ class SyncIsPerformedInteractor(private val userManager: UserManager?) { val username = userManager.d2.userModule().user().blockingGet()?.username() val dataBaseIsImport = userManager.d2.userModule().accountManager() - .getAccounts().firstOrNull { it.serverUrl() == serverUrl && it.username() == username } - ?.importDB() != null + .getAccounts() + .any { + it.serverUrl() == serverUrl && it.username() == username && it.importDB() != null + } return when { dataBaseIsImport -> true diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml index 18d2547402..9d25b41ef1 100644 --- a/app/src/main/res/layout/activity_login.xml +++ b/app/src/main/res/layout/activity_login.xml @@ -17,41 +17,6 @@ android:layout_height="match_parent" android:background="?colorPrimary"> - -