mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:11:45 +00:00
Refactor the NSDiffableDataSourceLayer (#1235)
* first part, using references * better animations * delete view provider and replaced wth two files * ordered dictionary usage * bubbled styler view previews * plain style is back * fix * read marker previews restored * updated tests * code improvements * better naming
This commit is contained in:
@@ -18,6 +18,8 @@ import Combine
|
||||
import SwiftUI
|
||||
import UIKit
|
||||
|
||||
import OrderedCollections
|
||||
|
||||
enum RoomScreenViewModelAction {
|
||||
case displayRoomDetails
|
||||
case displayEmojiPicker(itemID: String)
|
||||
@@ -84,7 +86,7 @@ struct RoomScreenViewState: BindableState {
|
||||
var roomId: String
|
||||
var roomTitle = ""
|
||||
var roomAvatarURL: URL?
|
||||
var items: [RoomTimelineViewProvider] = []
|
||||
var itemsDictionary = OrderedDictionary<String, RoomTimelineItemViewModel>()
|
||||
var members: [String: RoomMemberState] = [:]
|
||||
var canBackPaginate = true
|
||||
var isBackPaginating = false
|
||||
@@ -102,6 +104,14 @@ struct RoomScreenViewState: BindableState {
|
||||
var sendButtonDisabled: Bool {
|
||||
bindings.composerText.count == 0
|
||||
}
|
||||
|
||||
var itemIDs: [String] {
|
||||
itemsDictionary.keys.elements
|
||||
}
|
||||
|
||||
var itemViewModels: [RoomTimelineItemViewModel] {
|
||||
itemsDictionary.values.elements
|
||||
}
|
||||
|
||||
let scrollToBottomPublisher = PassthroughSubject<Void, Never>()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user