Skip to content

Commit

Permalink
Fix filters functionality on ResultsScreen (#31)
Browse files Browse the repository at this point in the history
This resolves the issue
  • Loading branch information
simosathan9 authored Jan 13, 2025
1 parent 59ec448 commit 8158558
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
Expand Down Expand Up @@ -59,7 +60,7 @@ fun ResultsScreen(
var selectedLocation by remember { mutableStateOf(searchUiState.selectedLocation) }
var selectedExperience by remember { mutableStateOf(searchUiState.selectedExperience) }

fun updateSearch() {
LaunchedEffect(selectedJobTitle, selectedLocation, selectedExperience) {
viewModel.searchCandidates(selectedJobTitle, selectedLocation, selectedExperience)
}

Expand Down Expand Up @@ -136,8 +137,6 @@ fun ResultsScreen(
1 -> selectedLocation = if (selected) "Any" else searchUiState.selectedLocation
2 -> selectedExperience = if (selected) "Any" else searchUiState.selectedExperience
}

updateSearch()
},
label = { Text(label) },
trailingIcon = {
Expand Down

0 comments on commit 8158558

Please sign in to comment.