NTP-31553 | Delete toast is not coming on last IAN delete (#14663)

This commit is contained in:
Sanjay P
2025-01-27 12:45:57 +05:30
committed by GitHub
parent abac02a8be
commit a2ef45d1af
3 changed files with 6 additions and 9 deletions

View File

@@ -25,7 +25,6 @@ import androidx.compose.material.pullrefresh.pullRefresh
import androidx.compose.material.pullrefresh.rememberPullRefreshState
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -46,7 +45,6 @@ import com.navi.design.font.naviFontFamily
import com.navi.pay.common.theme.color.NaviPayColor
import com.naviapp.R
import com.naviapp.home.activity.InAppNotificationActivity
import com.naviapp.home.model.ToastBarState
import com.naviapp.home.ui.theme.color.NotificationColor
import com.naviapp.home.viewmodel.NotificationVM
@@ -113,5 +111,4 @@ fun EmptyNotificationScreenRenderer(
modifier = Modifier.padding(top = 0.dp).align(Alignment.TopCenter),
)
}
LaunchedEffect(Unit) { notificationVM.updateToastBarState(ToastBarState(isVisible = false)) }
}

View File

@@ -66,6 +66,7 @@ fun NotificationScreenRenderer(
naeScreenName: String,
) {
val deletedNotifications by notificationVM.deletedNotificationsId.collectAsStateWithLifecycle()
val toastBarState by notificationVM.toastBarState.collectAsStateWithLifecycle()
val allNotificationDeleted =
deletedNotifications?.let { list ->
notificationData?.all { list.contains(it.notificationId) }
@@ -91,6 +92,11 @@ fun NotificationScreenRenderer(
naeScreenName = naeScreenName,
)
}
CustomToast(
isVisible = toastBarState.isVisible,
text = toastBarState.message.orEmpty(),
vm = notificationVM,
)
}
},
)

View File

@@ -114,7 +114,6 @@ fun BoxScope.NotificationWidgetsRenderer(
CompositionLocalProvider(LocalOverscrollConfiguration provides null) {
val bottomSheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden)
val bottomSheetScope = rememberCoroutineScope()
val toastBarState by notificationVM.toastBarState.collectAsStateWithLifecycle()
val bottomSheetData = remember { mutableStateOf(Notification()) }
val lazyListState = rememberLazyListState()
val isRefreshing by notificationVM.isRefreshing.collectAsStateWithLifecycle()
@@ -249,11 +248,6 @@ fun BoxScope.NotificationWidgetsRenderer(
)
}
}
CustomToast(
isVisible = toastBarState.isVisible,
text = toastBarState.message.orEmpty(),
vm = notificationVM,
)
}
}