From 7a79e6660a460de55902c6f244a14ddd8ace01f9 Mon Sep 17 00:00:00 2001 From: ows3090 Date: Sun, 19 May 2024 02:24:17 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20#76=20=EA=B8=B0=ED=83=80=20=EB=B8=8C?= =?UTF-8?q?=EB=9E=9C=EB=93=9C=20=EB=A7=88=EC=BB=A4=20=EA=B7=B8=EB=8C=80?= =?UTF-8?q?=EB=A1=9C=20=ED=91=9C=EC=8B=9C=EB=90=98=EB=8A=94=20=EC=9D=B4?= =?UTF-8?q?=EC=8A=88=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yapp/buddycon/map/MapScreen.kt | 8 ++++---- .../java/com/yapp/buddycon/map/MapViewModel.kt | 17 +++++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/feature/map/src/main/java/com/yapp/buddycon/map/MapScreen.kt b/feature/map/src/main/java/com/yapp/buddycon/map/MapScreen.kt index f3d1cae5..1cc9381f 100644 --- a/feature/map/src/main/java/com/yapp/buddycon/map/MapScreen.kt +++ b/feature/map/src/main/java/com/yapp/buddycon/map/MapScreen.kt @@ -220,7 +220,8 @@ private fun MapBottomSheet( .heightIn( min = BottomSheetValue.Collapsed.sheetPeekHeightDp.dp, max = BottomSheetValue.Expanded.sheetPeekHeightDp.dp - ).fillMaxSize() + ) + .fillMaxSize() .background(BuddyConTheme.colors.background) .pointerInput(Unit) { detectVerticalDragGestures( @@ -254,7 +255,7 @@ private fun MapBottomSheet( else -> { GifticonInfoModalSheetContent( countOfUsableGifticon = mapUiState.totalCount, - countOfImminetGifticon = mapUiState.deadLineCount, + countOfImminetGifticon = mapUiState.deadLineCount ) } } @@ -498,7 +499,7 @@ private fun transitionBottomSheet( current: BottomSheetValue, offset: Float ): BottomSheetValue { - val value = if (offset > 0f) { + return if (offset > 0f) { when (current) { BottomSheetValue.Collapsed -> BottomSheetValue.PartiallyExpanded BottomSheetValue.PartiallyExpanded -> BottomSheetValue.Expanded @@ -511,5 +512,4 @@ private fun transitionBottomSheet( BottomSheetValue.Expanded -> BottomSheetValue.PartiallyExpanded } } - return value } diff --git a/feature/map/src/main/java/com/yapp/buddycon/map/MapViewModel.kt b/feature/map/src/main/java/com/yapp/buddycon/map/MapViewModel.kt index 816c9f59..11dbdc28 100644 --- a/feature/map/src/main/java/com/yapp/buddycon/map/MapViewModel.kt +++ b/feature/map/src/main/java/com/yapp/buddycon/map/MapViewModel.kt @@ -15,6 +15,7 @@ import com.yapp.buddycon.utility.stability.MapSearchPlace import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.zip @@ -73,12 +74,16 @@ class MapViewModel @Inject constructor( ) { if (stores.isEmpty()) return stores.map { store -> - kakaoRepository.searchPlacesByKeyword( - query = store.value, - x = x, - y = y, - radius = 2000 - ) + if (store == GifticonStore.NONE || store == GifticonStore.OTHERS) { + flowOf(listOf()) + } else { + kakaoRepository.searchPlacesByKeyword( + query = store.value, + x = x, + y = y, + radius = 2000 + ) + } }.reduce { acc, flow -> acc.zip(flow) { searchPlaceModels, searchPlaceModel -> searchPlaceModels + searchPlaceModel