Do not show payment screen again if the user has already paid

This commit is contained in:
Aleksandras Kostarevas 2024-06-08 16:10:07 +03:00
parent 9ea64e0005
commit 0c4659004a
2 changed files with 12 additions and 6 deletions

View File

@ -92,12 +92,14 @@ fun HomeScreen(navController: NavHostController = rememberNavController()) {
icon = painterResource(id = R.drawable.eye)
)
NavigationItem(
title = stringResource(R.string.payment),
style = NavigationItemStyle.HomePrimary,
navigate = { navController.navigate("payment") },
icon = painterResource(R.drawable.dollar_sign)
)
if(!isPaid) {
NavigationItem(
title = stringResource(R.string.payment),
style = NavigationItemStyle.HomePrimary,
navigate = { navController.navigate("payment") },
icon = painterResource(R.drawable.dollar_sign)
)
}
NavigationItem(
title = "Help & Feedback",

View File

@ -356,6 +356,10 @@ fun PaymentScreen(
onExit: () -> Unit = { }
) {
val isAlreadyPaid = useDataStore(IS_ALREADY_PAID)
if(isAlreadyPaid.value) {
PaymentThankYouScreen(onExit)
return
}
val pushReminderTime = useDataStore(NOTICE_REMINDER_TIME)
val numDaysInstalled = useNumberOfDaysInstalled()
val forceShowNotice = useDataStore(FORCE_SHOW_NOTICE)