Remove debug switch

This commit is contained in:
Joren 2024-04-30 14:38:43 +02:00
parent e7b9269ab0
commit dec32634b5
Signed by untrusted user who does not match committer: Joren
GPG Key ID: 280E33DFBC0F1B55
2 changed files with 0 additions and 14 deletions

View File

@ -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(

View File

@ -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