Files
letro-ios/ElementX/Sources/Screens/Spaces/SpaceScreen/SpaceScreenModels.swift
Doug 940801f400 Add support for joining rooms from a space. (#4501)
* Add support for joining rooms from a space.

Doesn't yet handle the Join button 🤔

* Handle the join button for both rooms and spaces.

Also refactor more instances of spaceRoom to spaceRoomProxy.
2025-09-11 16:41:19 +01:00

33 lines
803 B
Swift

//
// Copyright 2025 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
// Please see LICENSE files in the repository root for full details.
//
import Foundation
enum SpaceScreenViewModelAction {
case selectSpace(SpaceRoomListProxyProtocol)
case selectRoom(roomID: String)
}
struct SpaceScreenViewState: BindableState {
let space: SpaceRoomProxyProtocol
var isPaginating = false
var rooms: [SpaceRoomProxyProtocol]
var selectedSpaceRoomID: String?
var joiningRoomIDs: Set<String> = []
var bindings = SpaceScreenViewStateBindings()
var spaceName: String { space.name ?? L10n.commonSpace }
}
struct SpaceScreenViewStateBindings { }
enum SpaceScreenViewAction {
case spaceAction(SpaceRoomCell.Action)
}