mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
build
This commit is contained in:
@@ -113,6 +113,8 @@ class ItemsModel: ObservableObject {
|
||||
// try? await Task.sleep(nanoseconds: 5000_000000)
|
||||
if let gap = await loadChat(chat: chat) {
|
||||
self.gaps = [gap]
|
||||
} else {
|
||||
self.gaps = []
|
||||
}
|
||||
navigationTimeout.cancel()
|
||||
progressTimeout.cancel()
|
||||
|
||||
@@ -303,30 +303,7 @@ struct ReverseList<Content: View>: UIViewControllerRepresentable {
|
||||
}
|
||||
|
||||
private func getFirstItemAfterPlacholder(_ indexPath: IndexPath) -> ChatItem? {
|
||||
if indexPath.row < preloadItem {
|
||||
return nil
|
||||
}
|
||||
|
||||
let closesPlaceholderRow = (0..<preloadItem).first { index in
|
||||
if let item = getItemAtPath(indexPath: IndexPath(row: indexPath.row - index, section: 0)) {
|
||||
return item.isPlaceholder
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
if let closesPlaceholderRow {
|
||||
var rowIndex = indexPath.row - closesPlaceholderRow
|
||||
while rowIndex < self.tableView.numberOfRows(inSection: 0) {
|
||||
if let item = getItemAtPath(indexPath: IndexPath(row: rowIndex, section: 0)), !item.isPlaceholder {
|
||||
return item
|
||||
}
|
||||
rowIndex += 1
|
||||
}
|
||||
|
||||
return nil
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user