Skip to content

Commit

Permalink
resolve error after main build success
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulWahabMemon committed Feb 19, 2024
1 parent 9fe6a7e commit 561dca2
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ enum class SharedPreferenceKey {
USER_INFO,
CARE_TEAM,
ORGANIZATION,
DATA_MIGRATION
}
2 changes: 1 addition & 1 deletion android/engine/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<string name="app_logo">Logo de l’application</string>
<string name="powered_by">Alimenté par</string>
<string name="app_version">Version de l\'application %1$d (%2$s)</string>
<string name="data_migration_version">migration de données %1$d</string>
<string name="data_migration_version">migration de données %1$s</string>
<string name="last_sync">Dernière synchronisation %1$s</string>
<string name="login_text">Connexion</string>
<string name="login_call_fail_error_message">Impossible de vérifier les informations d’identification à partir du serveur. Vérifiez votre connexion Internet</string>
Expand Down
2 changes: 1 addition & 1 deletion android/engine/src/main/res/values-sw/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>
<string name="app_version">Toleo %1$d(%2$s)</string>
<string name="data_migration_version">uhamiaji wa data %1$d</string>
<string name="data_migration_version">uhamiaji wa data %1$s</string>
<string name="last_sync">Usawazishaji wa mwisho %1$s</string>
<string name="language">Lugha</string>
<string name="empty_client_list_message_title">Hakuna Matokeo</string>
Expand Down
2 changes: 1 addition & 1 deletion android/engine/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<string name="app_logo">Application logo</string>
<string name="powered_by">Powered By</string>
<string name="app_version">App version %1$d(%2$s)</string>
<string name="data_migration_version">Migration Version %1$d</string>
<string name="data_migration_version">Migration Version %1$s</string>
<string name="last_sync">Last sync %1$s</string>
<string name="login_text">LOGIN</string>
<string name="login_call_fail_error_message">Failed to verify credentials from the server. Check your internet connection</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import org.smartregister.fhircore.engine.domain.model.RepositoryResourceData
import org.smartregister.fhircore.engine.domain.model.RuleConfig
import org.smartregister.fhircore.engine.rulesengine.ResourceDataRulesExecutor
import org.smartregister.fhircore.engine.util.DispatcherProvider
import org.smartregister.fhircore.engine.util.SharedPreferenceKey
import org.smartregister.fhircore.engine.util.extension.encodeResourceToString
import org.smartregister.fhircore.engine.util.extension.filterByFhirPathExpression
import org.smartregister.fhircore.engine.util.extension.showToast
Expand Down Expand Up @@ -148,6 +149,7 @@ constructor(
),
)
}
defaultRepository.sharedPreferencesHelper.write(SharedPreferenceKey.DATA_MIGRATION.name, previousVersion)
val maxVersion = migrationConfigs?.maxOfOrNull { it.version } ?: previousVersion
migrationConfigs?.forEach { migrationConfig ->
try {
Expand Down Expand Up @@ -220,6 +222,7 @@ constructor(
}
}
preferenceDataStore.write(PreferenceDataStore.MIGRATION_VERSION, maxVersion)
defaultRepository.sharedPreferencesHelper.write(SharedPreferenceKey.DATA_MIGRATION.name, maxVersion)
withContext(dispatcherProvider.main()) {
context.showToast(
context.getString(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fun UserSettingScreen(
mainNavController: NavController,
appVersionPair: Pair<Int, String>? = null,
allowP2PSync: Boolean,
dataMigrationVersion: Int,
dataMigrationVersion: String,
lastSyncTime: String?,
showProgressIndicatorFlow: MutableStateFlow<Boolean>,
) {
Expand Down Expand Up @@ -502,7 +502,7 @@ fun UserSettingPreview() {
mainNavController = rememberNavController(),
appVersionPair = Pair(1, "1.0.1"),
allowP2PSync = true,
dataMigrationVersion = 0,
dataMigrationVersion = "0",
lastSyncTime = "05:30 PM, Mar 3",
showProgressIndicatorFlow = MutableStateFlow(false),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ constructor(

fun retrieveCareTeam() = sharedPreferencesHelper.read(SharedPreferenceKey.CARE_TEAM.name, null)

fun retrieveDataMigrationVersion(): Int =
sharedPreferencesHelper.read(SharedPreferenceKey.MIGRATION_VERSION.name, "0")!!.toInt()
fun retrieveDataMigrationVersion(): String =
sharedPreferencesHelper.read(SharedPreferenceKey.DATA_MIGRATION.name, "0").toString()

fun retrieveLastSyncTimestamp(): String? =
sharedPreferencesHelper.read(SharedPreferenceKey.LAST_SYNC_TIMESTAMP.name, null)
Expand Down

0 comments on commit 561dca2

Please sign in to comment.