Skip to content

Commit 9a4c33d

Browse files
committed
feat : Modify launch 두번 수정
1 parent 2a6d561 commit 9a4c33d

File tree

2 files changed

+24
-27
lines changed

2 files changed

+24
-27
lines changed

presentation/src/main/java/com/stop/ui/map/MapFragment.kt

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -258,24 +258,22 @@ class MapFragment : Fragment() {
258258
}
259259

260260
private fun observeClickCurrentLocation() {
261-
viewLifecycleOwner.lifecycleScope.launch {
262-
launch {
263-
placeSearchViewModel.clickCurrentLocation
264-
.flowWithLifecycle(viewLifecycleOwner.lifecycle)
265-
.collect {
266-
val currentLocation = placeSearchViewModel.currentLocation
267-
val currentTmapPoint = TMapPoint(currentLocation.latitude, currentLocation.longitude)
268-
269-
tMapView.setCenterPoint(currentTmapPoint.latitude, currentTmapPoint.longitude)
270-
271-
setPanel(currentTmapPoint)
272-
273-
makeMarker(
274-
R.drawable.ic_baseline_location_on_32,
275-
currentTmapPoint
276-
)
277-
}
278-
}
261+
lifecycleScope.launch {
262+
placeSearchViewModel.clickCurrentLocation
263+
.flowWithLifecycle(viewLifecycleOwner.lifecycle)
264+
.collect {
265+
val currentLocation = placeSearchViewModel.currentLocation
266+
val currentTmapPoint = TMapPoint(currentLocation.latitude, currentLocation.longitude)
267+
268+
tMapView.setCenterPoint(currentTmapPoint.latitude, currentTmapPoint.longitude)
269+
270+
setPanel(currentTmapPoint)
271+
272+
makeMarker(
273+
R.drawable.ic_baseline_location_on_32,
274+
currentTmapPoint
275+
)
276+
}
279277
}
280278
}
281279

presentation/src/main/java/com/stop/ui/placesearch/PlaceSearchFragment.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,15 @@ class PlaceSearchFragment : Fragment() {
106106
}
107107

108108
private fun logErrorMessage() {
109-
viewLifecycleOwner.lifecycleScope.launch {
110-
launch {
111-
placeSearchViewModel.errorMessage
112-
.flowWithLifecycle(viewLifecycleOwner.lifecycle)
113-
.collect {
114-
if (it.isNotBlank()) {
115-
Log.e(PLACE_SEARCH_FRAGMENT, it)
116-
}
109+
lifecycleScope.launch {
110+
111+
placeSearchViewModel.errorMessage
112+
.flowWithLifecycle(viewLifecycleOwner.lifecycle)
113+
.collect {
114+
if (it.isNotBlank()) {
115+
Log.e(PLACE_SEARCH_FRAGMENT, it)
117116
}
118-
}
117+
}
119118
}
120119
}
121120

0 commit comments

Comments
 (0)