TP-67416 navigate to nux from home page oncreate after cheking eligib… (#11359)

This commit is contained in:
Hitesh Kumar
2024-06-14 17:59:37 +05:30
committed by GitHub
parent 7039842cee
commit 7972617800
3 changed files with 7 additions and 4 deletions

View File

@@ -351,7 +351,7 @@ class HomePageActivity :
AppLoadTimerMapper.initActivityStartTime()
installSplashScreen()
super.onCreate(savedInstanceState)
redirectionUseCase.redirectToDestination(intent.extras)
redirectionUseCase.redirectToDestination(intent.extras, homeVM)
enableEdgeToEdge(
statusBarStyle = SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT)
)

View File

@@ -21,6 +21,7 @@ import com.navi.common.utils.Constants.UPI_NUX_SCREEN
import com.naviapp.common.navigator.NaviDeepLinkNavigator
import com.naviapp.common.navigator.NaviDeepLinkNavigator.NAVIPAY
import com.naviapp.home.compose.activity.HomePageActivity
import com.naviapp.home.viewmodel.HomeVM
import com.naviapp.utils.Constants.IS_PERMISSION_REQUIRED_ON_HOME
import com.naviapp.utils.Constants.SOURCE
import com.naviapp.utils.isAllMandatoryPermissionGranted
@@ -40,10 +41,12 @@ constructor(
return extras?.getString(REDIRECTION_URL) == UPI_NUX_SCREEN
}
fun redirectToDestination(extras: Bundle?) {
fun redirectToDestination(extras: Bundle?, homeVM: HomeVM) {
when (extras?.getString(REDIRECTION_URL)) {
UPI_NUX_SCREEN -> {
navigateToUpiNuxScreen(extras.getString(SOURCE))
if (homeVM.nuxHandler.isUserEligibleForNux(UPI_NUX_SCREEN)) {
navigateToUpiNuxScreen(extras.getString(SOURCE))
}
}
}
}

View File

@@ -121,7 +121,7 @@ constructor(
getGsonBuilderForWidgetizedResponse()
.fromJson(response?.value, ForgeScreenDefinition::class.java)
private fun isUserEligibleForNux(screenId: String): Boolean {
fun isUserEligibleForNux(screenId: String): Boolean {
val nuxDisplayUserInfo =
PreferenceManager.getObjectPrefrences(
NUX_DISPLAY_USER_INFO.plus(UNDERSCORE).plus(screenId),