mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
shared section model
This commit is contained in:
@@ -28,7 +28,7 @@ struct ChatView: View {
|
||||
@Environment(\.scenePhase) var scenePhase
|
||||
@State @ObservedObject var chat: Chat
|
||||
@StateObject private var scrollModel = ReverseListScrollModel()
|
||||
@StateObject private var sectionModel = ReverseListSectionModel()
|
||||
@StateObject private var sectionModel = ReverseListSectionModel.shared
|
||||
@State private var showChatInfoSheet: Bool = false
|
||||
@State private var showAddMembersSheet: Bool = false
|
||||
@State private var composeState = ComposeState()
|
||||
|
||||
@@ -402,6 +402,7 @@ class ReverseListScrollModel: ObservableObject {
|
||||
|
||||
/// Manages ``ReverseList`` sections
|
||||
class ReverseListSectionModel: ObservableObject {
|
||||
static let shared = ReverseListSectionModel()
|
||||
@Published var activeSection: ChatSection = .bottom
|
||||
@Published private var itemSection: [Int64: ChatSection] = [:]
|
||||
@Published private var sections = Set<ChatSection>()
|
||||
|
||||
Reference in New Issue
Block a user