mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-09 16:55:51 +00:00
cleanup
This commit is contained in:
@@ -466,10 +466,10 @@ struct ChatView: View {
|
||||
|
||||
private var bag = Set<AnyCancellable>()
|
||||
|
||||
typealias ListState = (
|
||||
topItemDate: Date?,
|
||||
bottomItemId: ChatItem.ID?
|
||||
)
|
||||
struct ListState: Equatable {
|
||||
let topItemDate: Date?
|
||||
let bottomItemId: ChatItem.ID?
|
||||
}
|
||||
|
||||
private struct ViewUpdate: Equatable {
|
||||
let unreadBelow: Int
|
||||
@@ -504,6 +504,7 @@ struct ChatView: View {
|
||||
|
||||
// Date visibility
|
||||
listState
|
||||
.removeDuplicates()
|
||||
.map { _ in self.setDate(visibility: true) }
|
||||
// Hide the date after 1 second of no scrolling
|
||||
.debounce(for: 1, scheduler: DispatchQueue.main)
|
||||
|
||||
@@ -208,7 +208,7 @@ struct ReverseList<Content: View>: UIViewControllerRepresentable {
|
||||
visibleRows.last?.item ?? 0 < representer.items.count {
|
||||
let fbm = ChatView.FloatingButtonModel.shared
|
||||
fbm.scrollOffset.send(tableView.contentOffset.y + InvertedTableView.inset)
|
||||
fbm.listState.send((
|
||||
fbm.listState.send(.init(
|
||||
topItemDate: visibleRows
|
||||
.last { isVisible(indexPath: $0) }
|
||||
.map { representer.items[$0.item] }?
|
||||
|
||||
Reference in New Issue
Block a user