mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
remove no longer needed logs
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user