fix index

This commit is contained in:
anlicheng 2025-04-09 17:26:22 +08:00
parent f1bda5455f
commit a0f9ea9c5b

View File

@ -50,7 +50,6 @@ struct IndexMainView: View {
.contentShape(Rectangle()) .contentShape(Rectangle())
.highPriorityGesture( .highPriorityGesture(
TapGesture().onEnded { TapGesture().onEnded {
print("call me tap")
appNavigation.append(dest: .followList) appNavigation.append(dest: .followList)
} }
) )
@ -77,22 +76,29 @@ struct IndexMainView: View {
} }
} }
// // Rectangle()
// RefreshFooter(refreshing: $footerRefreshing, action: { .frame(height: 0)
// guard !self.showDateNavPopover else { .background(GeometryReader {
// return geometry in
// } Color.clear.onChange(of: geometry.frame(in: .global).minY) {_, offset in
//
// Task { let frame = geometry.frame(in: .global)
// self.footerRefreshing = true let screenBounds = UIScreen.main.bounds
// await self.indexModel.loadMoreUpdateDramas(userId: self.userId, mode: .next) let contextFrame = geometry.frame(in: .named("indexScrollView"))
// self.footerRefreshing = false
// } if screenBounds.height - frame.minY > 50 && contextFrame.minY > 0 && !footerRefreshing {
// }) { Task {
// ProgressView() self.footerRefreshing = true
// } await self.indexModel.loadMoreUpdateDramas(userId: self.userId, mode: .next)
// .noMore(noMore) self.footerRefreshing = false
// .preload(offset: 50) }
}
}
})
if self.footerRefreshing {
ProgressView()
}
} }
.frame(width: 370) .frame(width: 370)
.coordinateSpace(name: "indexScrollView") .coordinateSpace(name: "indexScrollView")
@ -155,9 +161,6 @@ struct IndexMainView: View {
self.visibleIndices = Set(offsets.compactMap { (id: Int, offset: CGFloat) in self.visibleIndices = Set(offsets.compactMap { (id: Int, offset: CGFloat) in
return offset >= 0 ? id : nil return offset >= 0 ? id : nil
}) })
print("visible indx: \(self.visibleIndices)")
} }
} }
} }