feat(content): 콘텐츠 탭 당겨서 새로고침을 추가한다
This commit is contained in:
@@ -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 {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user