fix(event): 이벤트 목록 중복 로드를 막는다
This commit is contained in:
@@ -11,6 +11,7 @@ import Kingfisher
|
||||
struct EventListView: View {
|
||||
|
||||
@ObservedObject var viewModel = EventListViewModel()
|
||||
@State private var hasLoadedEvents = false
|
||||
|
||||
var body: some View {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
@@ -50,6 +51,8 @@ struct EventListView: View {
|
||||
}
|
||||
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage, autohideIn: 2)
|
||||
.onAppear {
|
||||
guard !hasLoadedEvents else { return }
|
||||
hasLoadedEvents = true
|
||||
viewModel.getEvents()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user