diff --git a/app/src/main/java/org/dhis2/usescases/login/LoginViewModel.kt b/app/src/main/java/org/dhis2/usescases/login/LoginViewModel.kt index 1edd1c77ece..cba90747344 100644 --- a/app/src/main/java/org/dhis2/usescases/login/LoginViewModel.kt +++ b/app/src/main/java/org/dhis2/usescases/login/LoginViewModel.kt @@ -566,8 +566,7 @@ class LoginViewModel( } val importedMetadata = try { importResult.await() - } - catch (e: Exception) { + } catch (e: Exception) { view.displayMessage(resourceManager.parseD2Error(e)) Timber.e(e) null 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 862e96d92ad..0105c0e4b5f 100644 --- a/app/src/main/java/org/dhis2/usescases/login/SyncIsPerformedInteractor.kt +++ b/app/src/main/java/org/dhis2/usescases/login/SyncIsPerformedInteractor.kt @@ -4,12 +4,16 @@ import org.dhis2.data.server.UserManager import org.dhis2.usescases.sync.WAS_INITIAL_SYNC_DONE class SyncIsPerformedInteractor(private val userManager: UserManager?) { - fun execute(serverUrl: String, username: String): Boolean { + fun execute(): Boolean { if (userManager == null) return false val entryExists = userManager.d2.dataStoreModule().localDataStore().value( WAS_INITIAL_SYNC_DONE, ).blockingExists() + + val serverUrl = userManager.d2.systemInfoModule().systemInfo().blockingGet()?.contextPath() + val username = userManager.d2.userModule().user().blockingGet()?.username() + val dataBaseIsImport = userManager.d2.userModule().accountManager() .getAccounts().firstOrNull { it.serverUrl() == serverUrl && it.username() == username } ?.importDB() != null diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index adfc3f9ac6f..507920e4340 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ hilt = '2.47' hiltCompiler = '1.0.0' jacoco = '0.8.10' designSystem = "0.2-20240208.105715-18" -dhis2sdk = "1.10.0-20240207.110936-11" +dhis2sdk = "1.10.0-20240219.122222-17" ruleEngine = "2.1.9" appcompat = "1.6.1" annotation = "1.6.0"