mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 08:15:24 +00:00
b70e77f7c5
An unapproved account only gets the server's default contacts, which are its way to reach support — list them instead of discarding them, and hide the search field that cannot return anything.
54 lines
1.5 KiB
Swift
54 lines
1.5 KiB
Swift
//
|
|
// Copyright 2026 Novaloop AG
|
|
//
|
|
// 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 HealthChatMemberDirectoryScreenViewModelAction {
|
|
case selectMember(userID: String)
|
|
case presentRoom(roomID: String)
|
|
case editProfile
|
|
case invite
|
|
}
|
|
|
|
nonisolated enum HealthChatMemberDirectoryScreenContent: Equatable {
|
|
case loading
|
|
case members([HealthChatMember])
|
|
/// Not approved yet: the server's explanation alongside the default contacts it still allows.
|
|
case pendingApproval(message: String, members: [HealthChatMember])
|
|
case failure
|
|
}
|
|
|
|
struct HealthChatMemberDirectoryScreenViewState: BindableState {
|
|
var content: HealthChatMemberDirectoryScreenContent = .loading
|
|
|
|
/// Searching and inviting others are only available to approved accounts.
|
|
var isApproved = false
|
|
|
|
/// The hint shown while the own profile is missing required fields.
|
|
var completenessMessage: String?
|
|
|
|
var bindings = HealthChatMemberDirectoryScreenViewStateBindings()
|
|
}
|
|
|
|
struct HealthChatMemberDirectoryScreenViewStateBindings {
|
|
var searchQuery = ""
|
|
var alertInfo: AlertInfo<HealthChatMemberDirectoryScreenAlertType>?
|
|
}
|
|
|
|
enum HealthChatMemberDirectoryScreenAlertType: Hashable {
|
|
case failedStartingChat
|
|
}
|
|
|
|
enum HealthChatMemberDirectoryScreenViewAction {
|
|
case retry
|
|
case refresh
|
|
case selectMember(HealthChatMember)
|
|
case startChat(HealthChatMember)
|
|
case editProfile
|
|
case invite
|
|
}
|