Remove debug switch
This commit is contained in:
parent
e7b9269ab0
commit
dec32634b5
@ -29,11 +29,6 @@ fun FavoritesScreen(viewModel: FavouritesViewModel) {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun Favorites(favoritesViewModel: FavouritesViewModel) {
|
fun Favorites(favoritesViewModel: FavouritesViewModel) {
|
||||||
// Function to toggle debug mode
|
|
||||||
val toggleDebugMode: () -> Unit = {
|
|
||||||
favoritesViewModel.toggleDebugMode()
|
|
||||||
}
|
|
||||||
|
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
favoritesViewModel.loadFavourites()
|
favoritesViewModel.loadFavourites()
|
||||||
}
|
}
|
||||||
@ -72,11 +67,6 @@ fun Favorites(favoritesViewModel: FavouritesViewModel) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Text(
|
|
||||||
text = "Toggle Debug Mode",
|
|
||||||
modifier = Modifier.clickable { toggleDebugMode() }
|
|
||||||
)
|
|
||||||
|
|
||||||
favorites?.let { favoritesList ->
|
favorites?.let { favoritesList ->
|
||||||
if (favoritesList.isNotEmpty()) {
|
if (favoritesList.isNotEmpty()) {
|
||||||
LazyVerticalGrid(
|
LazyVerticalGrid(
|
||||||
|
@ -27,10 +27,6 @@ class FavouritesViewModel(private val favouritesRepository: FavouritesRepository
|
|||||||
private val _pokemonDetails = MutableStateFlow<List<PokemonDetails>?>(null)
|
private val _pokemonDetails = MutableStateFlow<List<PokemonDetails>?>(null)
|
||||||
val pokemonDetails: StateFlow<List<PokemonDetails>?> = _pokemonDetails.asStateFlow()
|
val pokemonDetails: StateFlow<List<PokemonDetails>?> = _pokemonDetails.asStateFlow()
|
||||||
val accessCheckFailed: MutableState<Boolean> = mutableStateOf(false)
|
val accessCheckFailed: MutableState<Boolean> = mutableStateOf(false)
|
||||||
|
|
||||||
fun toggleDebugMode() {
|
|
||||||
featureManager.setPaidFeatureEnabled(!featureManager.hasAccessToPaidFeature())
|
|
||||||
}
|
|
||||||
fun loadFavourites() {
|
fun loadFavourites() {
|
||||||
// featureManager.setPaidFeatureEnabled(false) enable and disable acccess
|
// featureManager.setPaidFeatureEnabled(false) enable and disable acccess
|
||||||
// Ugly workaround to make sure all the favourites are loaded before displaying them
|
// Ugly workaround to make sure all the favourites are loaded before displaying them
|
||||||
|
Loading…
x
Reference in New Issue
Block a user