diff --git a/cmp-android/prodRelease-badging.txt b/cmp-android/prodRelease-badging.txt index 2ad232ca..3f44344b 100644 --- a/cmp-android/prodRelease-badging.txt +++ b/cmp-android/prodRelease-badging.txt @@ -1,4 +1,4 @@ -package: name='org.mifospay' versionCode='1' versionName='2025.10.5-beta.0.9' platformBuildVersionName='15' platformBuildVersionCode='35' compileSdkVersion='35' compileSdkVersionCodename='15' +package: name='org.mifospay' versionCode='1' versionName='2025.10.5-beta.0.10' platformBuildVersionName='15' platformBuildVersionCode='35' compileSdkVersion='35' compileSdkVersionCodename='15' minSdkVersion:'26' targetSdkVersion:'34' uses-permission: name='android.permission.INTERNET' diff --git a/cmp-shared/src/commonMain/kotlin/org/mifospay/shared/instance/InstanceSelectorViewModel.kt b/cmp-shared/src/commonMain/kotlin/org/mifospay/shared/instance/InstanceSelectorViewModel.kt index 4ff28184..28a7149d 100644 --- a/cmp-shared/src/commonMain/kotlin/org/mifospay/shared/instance/InstanceSelectorViewModel.kt +++ b/cmp-shared/src/commonMain/kotlin/org/mifospay/shared/instance/InstanceSelectorViewModel.kt @@ -25,7 +25,6 @@ import org.mifospay.core.model.instance.ServerInstance import org.mifospay.core.network.config.InstanceConfigLoader import org.mifospay.core.ui.utils.BaseViewModel -@Suppress("`suppressLintsFor`") class InstanceSelectorViewModel( instanceConfigLoader: InstanceConfigLoader, private val userPreferencesRepository: UserPreferencesRepository, @@ -33,8 +32,8 @@ class InstanceSelectorViewModel( initialState = InstanceSelectorState(), ) { - private val _tempSelectedMainInstance = MutableStateFlow(null) - private val _tempSelectedInterbankInstance = MutableStateFlow(null) + private val tempSelectedMainInstance = MutableStateFlow(null) + private val tempSelectedInterbankInstance = MutableStateFlow(null) init { // Combine all sources and update state @@ -42,8 +41,8 @@ class InstanceSelectorViewModel( instanceConfigLoader.observeInstancesConfig(), userPreferencesRepository.selectedInstance, userPreferencesRepository.selectedInterbankInstance, - _tempSelectedMainInstance, - _tempSelectedInterbankInstance, + tempSelectedMainInstance, + tempSelectedInterbankInstance, ) { remoteConfig, selectedMainInstance, selectedInterbankInstance, tempMainInstance, tempInterbankInstance -> when (remoteConfig) { is DataState.Success -> { @@ -94,11 +93,11 @@ class InstanceSelectorViewModel( is InstanceSelectorAction.SelectInstance -> { when (action.instance.type) { InstanceType.MAIN -> { - _tempSelectedMainInstance.value = action.instance + tempSelectedMainInstance.value = action.instance } InstanceType.INTERBANK -> { - _tempSelectedInterbankInstance.value = action.instance + tempSelectedInterbankInstance.value = action.instance } } } @@ -117,23 +116,23 @@ class InstanceSelectorViewModel( viewModelScope.launch { val currentState = state val mainInstanceChanged = - _tempSelectedMainInstance.value != currentState.selectedMainInstance + tempSelectedMainInstance.value != currentState.selectedMainInstance val interbankInstanceChanged = - _tempSelectedInterbankInstance.value != currentState.selectedInterbankInstance + tempSelectedInterbankInstance.value != currentState.selectedInterbankInstance - if (mainInstanceChanged && _tempSelectedMainInstance.value != null) { - userPreferencesRepository.updateSelectedInstance(_tempSelectedMainInstance.value!!) + if (mainInstanceChanged && tempSelectedMainInstance.value != null) { + userPreferencesRepository.updateSelectedInstance(tempSelectedMainInstance.value!!) } - if (interbankInstanceChanged && _tempSelectedInterbankInstance.value != null) { + if (interbankInstanceChanged && tempSelectedInterbankInstance.value != null) { userPreferencesRepository.updateSelectedInterbankInstance( - _tempSelectedInterbankInstance.value!!, + tempSelectedInterbankInstance.value!!, ) } // Reset temp selections after update - _tempSelectedMainInstance.value = null - _tempSelectedInterbankInstance.value = null + tempSelectedMainInstance.value = null + tempSelectedInterbankInstance.value = null sendEvent(InstanceSelectorEvent.DismissSheet) } @@ -153,7 +152,7 @@ data class InstanceSelectorState( ) { val isUpdateEnabled: Boolean get() = tempSelectedMainInstance != selectedMainInstance || - tempSelectedInterbankInstance != selectedInterbankInstance + tempSelectedInterbankInstance != selectedInterbankInstance } // Events