fix(event): 이벤트 목록 중복 로드를 막는다

This commit is contained in:
Yu Sung
2026-08-25 18:23:55 +09:00
parent d1cb2e28a6
commit fc0f7e2b50
3 changed files with 351 additions and 0 deletions

View File

@@ -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()
}
}