mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 11:58:32 +00:00
Navigate to the Pinned events timeline (#3139)
This commit is contained in:
@@ -30,6 +30,7 @@ enum RoomDetailsScreenViewModelAction {
|
||||
case requestPollsHistoryPresentation
|
||||
case requestRolesAndPermissionsPresentation
|
||||
case startCall
|
||||
case displayPinnedEventsTimeline
|
||||
}
|
||||
|
||||
// MARK: View
|
||||
@@ -52,6 +53,8 @@ struct RoomDetailsScreenViewState: BindableState {
|
||||
var canEditRolesOrPermissions = false
|
||||
var notificationSettingsState: RoomDetailsNotificationSettingsState = .loading
|
||||
var canJoinCall = false
|
||||
var isPinningEnabled = false
|
||||
var pinnedEventsActionState = RoomDetailsScreenPinnedEventsActionState.loading
|
||||
|
||||
var canEdit: Bool {
|
||||
!isDirect && (canEditRoomName || canEditRoomTopic || canEditRoomAvatar)
|
||||
@@ -194,6 +197,7 @@ enum RoomDetailsScreenViewAction {
|
||||
case toggleFavourite(isFavourite: Bool)
|
||||
case processTapRolesAndPermissions
|
||||
case processTapCall
|
||||
case processTapPinnedEvents
|
||||
}
|
||||
|
||||
enum RoomDetailsScreenViewShortcut {
|
||||
@@ -261,3 +265,26 @@ enum RoomDetailsScreenErrorType: Hashable {
|
||||
/// Leaving room has failed..
|
||||
case unknown
|
||||
}
|
||||
|
||||
enum RoomDetailsScreenPinnedEventsActionState {
|
||||
case loading
|
||||
case loaded(numberOfItems: Int)
|
||||
|
||||
var count: String {
|
||||
switch self {
|
||||
case .loading:
|
||||
return ""
|
||||
case .loaded(let numberOfItems):
|
||||
return "\(numberOfItems)"
|
||||
}
|
||||
}
|
||||
|
||||
var isLoading: Bool {
|
||||
switch self {
|
||||
case .loading:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user