NTP-2342 | Kamalesh | Add crash fixes (#12242)
This commit is contained in:
committed by
GitHub
parent
f83f0895bf
commit
218d36bc33
@@ -57,7 +57,6 @@ import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.Density
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import androidx.paging.LoadState
|
||||
import androidx.paging.compose.LazyPagingItems
|
||||
@@ -193,6 +192,7 @@ fun ScratchCardListRenderer(
|
||||
}
|
||||
scratchCardList(
|
||||
lazyGridScope = this@LazyVerticalGrid,
|
||||
viewModel = viewModel,
|
||||
paginatedHistoryScreenState = paginatedHistoryScreenState.value,
|
||||
scratchHistoryCardList = scratchHistoryCardList,
|
||||
metadata = metadata,
|
||||
@@ -226,6 +226,7 @@ fun ScratchCardListRenderer(
|
||||
|
||||
fun scratchCardList(
|
||||
lazyGridScope: LazyGridScope,
|
||||
viewModel: ScratchCardScreenVM,
|
||||
paginatedHistoryScreenState: ScratchCardPaginatedHistoryScreenState,
|
||||
scratchHistoryCardList: LazyPagingItems<ScratchCard>,
|
||||
metadata: Map<String?, String?>?,
|
||||
@@ -267,6 +268,7 @@ fun scratchCardList(
|
||||
) {
|
||||
ScratchCardLockedOrExpired(
|
||||
scratchCard = item,
|
||||
viewModel = viewModel,
|
||||
renderBottomSheet = renderBottomSheet,
|
||||
firstElement = firstElement,
|
||||
metadata = metadata,
|
||||
@@ -291,7 +293,7 @@ fun scratchCardList(
|
||||
fun ScratchCardLockedOrExpired(
|
||||
modifier: Modifier = Modifier,
|
||||
scratchCard: ScratchCard,
|
||||
viewModel: ScratchCardScreenVM = hiltViewModel(),
|
||||
viewModel: ScratchCardScreenVM,
|
||||
firstElement: Boolean,
|
||||
metadata: Map<String?, String?>? = null,
|
||||
analyticsHelper: NaviRRAnalytics.Rewards,
|
||||
|
||||
@@ -594,13 +594,14 @@ private fun CoinHomeScreenBody(
|
||||
Modifier.padding(top = 24.dp, bottom = paddingValues.calculateBottomPadding())
|
||||
) {
|
||||
state.data.screenStructure?.content?.widgets?.forEachIndexed { index, uiTronWidget ->
|
||||
key(uiTronWidget.widgetName.orElse(index.toString())) {
|
||||
key(uiTronWidget?.widgetName.orElse(index.toString())) {
|
||||
WidgetRenderer(
|
||||
widget = uiTronWidget,
|
||||
viewModel = coinHomeScreenVM,
|
||||
modifier =
|
||||
Modifier.onGloballyPositioned { coordinates ->
|
||||
widgetYOffsetMap[uiTronWidget.widgetName.orElse(index.toString())] =
|
||||
widgetYOffsetMap[
|
||||
uiTronWidget?.widgetName.orElse(index.toString())] =
|
||||
coordinates.positionInParent().y.toInt()
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user