Skip to content

Commit

Permalink
#86 fix : 레스토랑 삭제 후 홈 화면 앱 버그 수정
Browse files Browse the repository at this point in the history
Co-authored-by: plashdof <[email protected]>
Co-authored-by: yy0ung <[email protected]>
  • Loading branch information
3 people committed Dec 11, 2023
1 parent 057c3f0 commit 538e248
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ data class HomeUiState(
val curLatitude: Double = 0.0,
val curLongitude: Double = 0.0,
val curSelectedMarker: Marker? = null,
val addRestaurantId: Int = -1
val addRestaurantId: Int = 0
)

sealed class TrackingState {
Expand Down Expand Up @@ -379,7 +379,7 @@ class HomeViewModel @Inject constructor(

private fun moveCamera() {
if (_uiState.value.markerList.isEmpty()) return
if (uiState.value.addRestaurantId != 0) {
if (uiState.value.addRestaurantId > 0) {
val restaurantItem: UiRestaurantData =
uiState.value.markerList.first { it.id == uiState.value.addRestaurantId }
_uiState.update { state ->
Expand Down Expand Up @@ -461,7 +461,7 @@ class HomeViewModel @Inject constructor(
}

fun setAddRestaurantId(restaurantId: Int) {
if (restaurantId != -1) {
if (restaurantId <= 0) {
_uiState.update { state ->
state.copy(
addRestaurantId = restaurantId
Expand Down

0 comments on commit 538e248

Please sign in to comment.