feat(content): 콘텐츠 탭 당겨서 새로고침을 추가한다

This commit is contained in:
Yu Sung
2026-08-18 13:30:15 +09:00
parent d2561272c0
commit bdd885a082
6 changed files with 135 additions and 30 deletions

View File

@@ -32,7 +32,7 @@ final class MainContentAllViewModel: ObservableObject {
}
func fetchFirstPageIfNeeded() {
guard hasLoaded == false else { return }
guard hasLoaded == false, isLoading == false else { return }
fetchFirstPage()
}
@@ -40,6 +40,16 @@ final class MainContentAllViewModel: ObservableObject {
fetchContents(page: 0, isNextPage: false)
}
func refresh() async {
if !isLoading {
fetchFirstPage()
}
for await isLoading in $isLoading.values {
if !isLoading { return }
}
}
func apply(type: MainContentAllType, sort: ContentSort) {
guard allowedSorts(for: type).contains(sort) else { return }
@@ -247,4 +257,3 @@ extension SeriesPublishedDaysOfWeek {
}
}
}