NTP-60013 | Sohan | Added session level action handling for HomePage. (#16427)
This commit is contained in:
committed by
GitHub
parent
8fda1d6379
commit
9a0e75c76a
@@ -180,9 +180,7 @@ constructor(
|
||||
isFirstRender = false,
|
||||
)
|
||||
onContentSynchronized()
|
||||
if (!isDataUnchanged) {
|
||||
onHomeFetchSuccessFromNetwork()
|
||||
}
|
||||
onHomeFetchSuccessFromNetwork()
|
||||
onSelectiveRefreshStateChange(SelectiveRefreshState.SUCCESS)
|
||||
},
|
||||
)
|
||||
@@ -311,9 +309,7 @@ constructor(
|
||||
eventHandler(HpEvents.RenderedFirstTime)
|
||||
}
|
||||
onContentSynchronized()
|
||||
if (!isDataUnchanged) {
|
||||
onHomeFetchSuccessFromNetwork()
|
||||
}
|
||||
onHomeFetchSuccessFromNetwork()
|
||||
onSelectiveRefreshStateChange(SelectiveRefreshState.SUCCESS)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -10,6 +10,7 @@ package com.naviapp.home.viewmodel
|
||||
import android.content.Context
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.navi.analytics.utils.NaviTrackEvent
|
||||
@@ -116,6 +117,8 @@ constructor(
|
||||
var widgetsDisplayed by mutableIntStateOf(0)
|
||||
private set
|
||||
|
||||
private var postApiOneTimeActionTriggered by mutableStateOf(false)
|
||||
|
||||
fun updateDisplayedWidgetCount(count: Int) {
|
||||
widgetsDisplayed = count
|
||||
}
|
||||
@@ -307,6 +310,12 @@ constructor(
|
||||
naviAnalyticsEventTracker.onHomePageApiResponse(
|
||||
System.currentTimeMillis() - analyticsStartTs
|
||||
)
|
||||
if (postApiOneTimeActionTriggered.not()) {
|
||||
state.value.renderActions?.postApiOneTimeAction?.let {
|
||||
handleActions(it)
|
||||
postApiOneTimeActionTriggered = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun handleCtaData(
|
||||
|
||||
@@ -85,6 +85,8 @@ data class AlchemistRenderActions(
|
||||
null, // This contains a list of actions corresponding to specific app events
|
||||
val onImpressionAction: UiTronActionData? =
|
||||
null, // These actions will trigger on actual view of the widget on the screen
|
||||
val postApiOneTimeAction: UiTronActionData? =
|
||||
null, // These actions will trigger once in a session after a successful API call
|
||||
)
|
||||
|
||||
data class AlchemistActionsCorrespondingToKey(
|
||||
|
||||
Reference in New Issue
Block a user