Skip to content

Commit a82d6dc

Browse files
committed
πŸ› [fix] μ—λŸ¬ νŽ˜μ΄μ§€μ—μ„œ λ²„νŠΌ ν„°μΉ˜ μ‹œ λ‘œλ”© 인디케이터가 보여지도둝 κ°œμ„ 
1 parent c30a6d8 commit a82d6dc

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

β€ŽFitfty/Projects/MainFeed/Sources/Main/Home/ViewController/MainViewController.swiftβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,11 @@ private extension MainViewController {
355355
}
356356

357357
@objc func didTapPrevButton(_ sender: FitftyButton) {
358-
viewModel.input.refresh()
358+
viewModel.input.reload()
359359
}
360360

361361
@objc func didTapMainButton(_ sender: FitftyButton) {
362-
viewModel.input.refresh()
362+
viewModel.input.reload()
363363
}
364364

365365
}

β€ŽFitfty/Projects/MainFeed/Sources/Main/Home/ViewModel/MainViewModel.swiftβ€Ž

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ protocol MainViewModelInput {
1919

2020
func refresh()
2121

22+
func reload()
23+
2224
func didTapTag(_ tag: Tag)
2325
}
2426

@@ -118,6 +120,17 @@ extension MainViewModel: MainViewModelInput {
118120
LocationManager.shared.requestLocation()
119121
}
120122

123+
func reload() {
124+
guard case .isLoading(let isLoading) = currentState.value, isLoading == false,
125+
let longitude = _location.value.longitude, let latitude = _location.value.latitude
126+
else {
127+
return
128+
}
129+
currentState.send(.isLoading(true))
130+
update(longitude: longitude, latitude: latitude)
131+
LocationManager.shared.requestLocation()
132+
}
133+
121134
func didTapTag(_ tag: Tag) {
122135
updateTags(tag)
123136
Task { [weak self] in

0 commit comments

Comments
Β (0)