From b510be61efd1ce890c695818b6b7f0b242e69a2e Mon Sep 17 00:00:00 2001 From: Mostafa Mohamed Date: Sat, 9 Nov 2024 23:15:45 +0200 Subject: [PATCH] Update giveaways filter events to accept nullable parameters --- .../screens/deals_screen/DealsAndGiveawayScreenUiEvent.kt | 6 +++--- .../freegames/ui/screens/deals_screen/DealsScreen.kt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/mostafadevo/freegames/ui/screens/deals_screen/DealsAndGiveawayScreenUiEvent.kt b/app/src/main/java/com/mostafadevo/freegames/ui/screens/deals_screen/DealsAndGiveawayScreenUiEvent.kt index 636c9ac..361890b 100644 --- a/app/src/main/java/com/mostafadevo/freegames/ui/screens/deals_screen/DealsAndGiveawayScreenUiEvent.kt +++ b/app/src/main/java/com/mostafadevo/freegames/ui/screens/deals_screen/DealsAndGiveawayScreenUiEvent.kt @@ -54,15 +54,15 @@ sealed class DealsAndGiveawayScreenUiEvent { ) : DealsAndGiveawayScreenUiEvent() data class OnGiveawaysSortByFilterChanged( - val sortBy: String + val sortBy: String? ) : DealsAndGiveawayScreenUiEvent() data class OnGiveawaysTypeFilterChanged( - val type: String + val type: String? ) : DealsAndGiveawayScreenUiEvent() data class OnGiveawaysPlatformFilterChanged( - val platform: String + val platform: String? ) : DealsAndGiveawayScreenUiEvent() data object OnApplyGiveawaysFilters : DealsAndGiveawayScreenUiEvent() diff --git a/app/src/main/java/com/mostafadevo/freegames/ui/screens/deals_screen/DealsScreen.kt b/app/src/main/java/com/mostafadevo/freegames/ui/screens/deals_screen/DealsScreen.kt index cd177b8..77d5dfd 100644 --- a/app/src/main/java/com/mostafadevo/freegames/ui/screens/deals_screen/DealsScreen.kt +++ b/app/src/main/java/com/mostafadevo/freegames/ui/screens/deals_screen/DealsScreen.kt @@ -769,7 +769,7 @@ fun DealsScreen( if (state.giveawaysFilterSortBy == it) { viewModel.onEvent( DealsAndGiveawayScreenUiEvent.OnGiveawaysSortByFilterChanged( - "" + null ) ) } else { @@ -825,7 +825,7 @@ fun DealsScreen( if (state.giveawaysFilterType == it) { viewModel.onEvent( DealsAndGiveawayScreenUiEvent.OnGiveawaysTypeFilterChanged( - "" + null ) ) } else { @@ -880,7 +880,7 @@ fun DealsScreen( if (state.giveawaysFilterPlatform == it) { viewModel.onEvent( DealsAndGiveawayScreenUiEvent.OnGiveawaysPlatformFilterChanged( - "" + null ) ) } else {