remove no longer needed logs

This commit is contained in:
Diogo
2024-11-07 22:36:23 +00:00
parent a2f4615895
commit f167b31e85
3 changed files with 2 additions and 11 deletions
+2 -2
View File
@@ -318,8 +318,8 @@ private func apiChatsResponse(_ r: ChatResponse) throws -> [ChatData] {
throw r
}
let loadItemsPerPage = 100
let preloadItem = 25
let loadItemsPerPage = 50
let preloadItem = 8
let idealChatListSize = 500
func apiGetChat(type: ChatType, id: Int64, search: String = "") async throws -> (Chat, Int?) {
@@ -491,12 +491,9 @@ struct ChatView: View {
}
private func getFirstUnreadItem() -> ChatItem? {
logger.error("[scrolling] \(im.reversedChatItems.count)")
for i in stride(from: im.reversedChatItems.count - 1, through: 0, by: -1) {
let item = im.reversedChatItems[i]
if item.isRcvNew {
logger.error("[scrolling] First unread item: \(item.text)")
return item
}
}
@@ -166,7 +166,6 @@ struct ReverseList<Content: View>: UIViewControllerRepresentable {
if !isVisible(indexPath: indexPath) {
if tableView.numberOfRows(inSection: indexPath.section) > indexPath.row {
let cellRect = tableView.rectForRow(at: indexPath)
logger.error("[scrolling] minY: \(cellRect.minY), maxY: \(cellRect.maxY) y: \(cellRect.origin.y)")
tableView.setContentOffset(CGPoint(x: 0, y: cellRect.maxY - tableView.bounds.height), animated: false)
}
}
@@ -269,7 +268,6 @@ struct ReverseList<Content: View>: UIViewControllerRepresentable {
visibleRows.last?.item ?? 0 < renderedItems.count {
let scrollOffset: Double = tableView.contentOffset.y + InvertedTableView.inset
logger.error("[scrolling] scroll offset: \(scrollOffset)")
let topItemDate: Date? =
if let lastVisible = visibleRows.last(where: { isVisible(indexPath: $0) }) {
renderedItems[lastVisible.item].meta.itemTs
@@ -423,18 +421,14 @@ class ReverseListScrollModel: ObservableObject {
@Published var state: State = .atDestination
func scrollToNextPage() {
logger.error("[scrolling] to next page")
state = .scrollingTo(.nextPage)
}
func scrollToBottom() {
logger.error("[scrolling] to bottom")
state = .scrollingTo(.bottom)
}
func scrollToItem(id: ChatItem.ID) {
logger.error("[scrolling] to item \(id)")
state = .scrollingTo(.item(id))
}
}