Skip to content

Commit

Permalink
Merge branch 'fix/#184-register-to-explore' into fix/#186-lock-regist…
Browse files Browse the repository at this point in the history
…er-button
  • Loading branch information
angryPodo committed Jan 24, 2025
2 parents 9997d4b + 0c26b76 commit bc840f3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.spoony.spoony.presentation.map.navigaion.Map
import com.spoony.spoony.presentation.map.navigaion.navigateToMap
import com.spoony.spoony.presentation.map.search.navigation.navigateToMapSearch
import com.spoony.spoony.presentation.placeDetail.navigation.navigateToPlaceDetail
import com.spoony.spoony.presentation.register.navigation.Register
import com.spoony.spoony.presentation.register.navigation.navigateToRegister
import com.spoony.spoony.presentation.report.navigation.navigateToReport

Expand Down Expand Up @@ -64,12 +65,22 @@ class MainNavigator(
}

fun navigateToExplore(
navOptions: NavOptions? = navOptions {
popUpTo(Explore) {
inclusive = false
fromRegister: Boolean = false,
navOptions: NavOptions? = if (fromRegister) {
navOptions {
popUpTo(Register) {
inclusive = true
}
launchSingleTop = true
}
} else {
navOptions {
popUpTo(Explore) {
inclusive = false
}
restoreState = true
launchSingleTop = true
}
restoreState = true
launchSingleTop = true
}
) {
navController.navigateToExplore(navOptions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fun MainScreen(

registerNavGraph(
paddingValues = paddingValues,
navigateToExplore = navigator::navigateToExplore
navigateToExplore = { navigator.navigateToExplore(fromRegister = true) }
)

placeDetailNavGraph(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ class RegisterViewModel @Inject constructor(
viewModelScope.launch {
_state.update { currentState ->
RegisterState(
categories = currentState.categories
categories = currentState.categories,
showRegisterSnackBar = false
)
}
}
Expand Down

0 comments on commit bc840f3

Please sign in to comment.