Pinned Items Banner UI (#3072)

This commit is contained in:
Mauro
2024-07-22 14:57:04 +02:00
committed by GitHub
parent ff33c07596
commit 5cb44ee60c
15 changed files with 236 additions and 24 deletions
@@ -360,7 +360,7 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
state.canCurrentUserRedactSelf = false
}
if appSettings.pinningEnabled,
if state.isPinningEnabled,
case let .success(value) = await roomProxy.canUser(userID: roomProxy.ownUserID, sendStateEvent: .roomPinnedEvents) {
state.canCurrentUserPin = value
} else {
@@ -414,6 +414,10 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
.weakAssign(to: \.state.isViewSourceEnabled, on: self)
.store(in: &cancellables)
appSettings.$pinningEnabled
.weakAssign(to: \.state.isPinningEnabled, on: self)
.store(in: &cancellables)
roomProxy.membersPublisher
.receive(on: DispatchQueue.main)
.sink { [weak self] in self?.updateMembers($0) }