NTP-66960 | Naman Khurmi | Added safe launch and default null value. (#16589)

This commit is contained in:
Naman Khurmi
2025-06-16 14:44:33 +05:30
committed by GitHub
parent 17e217f1fe
commit 4c1eab8c04
3 changed files with 5 additions and 4 deletions

View File

@@ -33,6 +33,7 @@ import com.navi.common.utils.deviceId
import com.navi.common.utils.getAppsflyerUid
import com.navi.common.utils.isValidResponse
import com.navi.common.utils.log
import com.navi.common.utils.safeLaunch
import com.naviapp.app.NaviApplication
import com.naviapp.common.repository.ConfigRepository
import com.naviapp.launcher.helper.GuardDogSdkInitializer
@@ -154,7 +155,7 @@ constructor(
}
fun fetchLoginSettings(naeScreenName: String) {
viewModelScope.launch(Dispatchers.IO) {
viewModelScope.safeLaunch(Dispatchers.IO) {
val response = registerRepository.fetchLoginSettings(naeScreenName = naeScreenName)
if (response.error == null) {
_loginSettings.postValue(response.data)

View File

@@ -41,7 +41,7 @@ class ConfigVM @Inject constructor() : BaseVM(isExceptionNeedToShow = false) {
get() = _loginSettings
fun fetchLoginSettings(naeScreenName: String) {
coroutineScope.launch(Dispatchers.IO) {
viewModelScope.safeLaunch(Dispatchers.IO) {
val response = registerRepository.fetchLoginSettings(naeScreenName = naeScreenName)
if (response.error == null) {
_loginSettings.postValue(response.data)

View File

@@ -1,6 +1,6 @@
/*
*
* * Copyright © 2019-2023 by Navi Technologies Limited
* * Copyright © 2019-2025 by Navi Technologies Limited
* * All rights reserved. Strictly confidential
*
*/
@@ -15,7 +15,7 @@ import kotlinx.parcelize.Parcelize
data class AppUpgradeResponse(
@SerializedName("softUpgrade") val softUpgrade: Boolean?,
@SerializedName("hardUpgrade") val hardUpgrade: Boolean?,
@SerializedName("expectedAppVersionCode") val expectedAppVersionCode: Int?,
@SerializedName("expectedAppVersionCode") val expectedAppVersionCode: Int? = null,
@SerializedName("downloadableUrl") val downloadableUrl: String? = null,
@SerializedName("verificationHash") val verificationHash: String? = null,
@SerializedName("updateType") val updateType: String? = null,