shared section model

This commit is contained in:
Diogo
2024-10-19 14:00:00 +01:00
parent 8c31bd5dd1
commit bd5a51c366
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -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>()