mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:44:05 +00:00
Add a banner to encrypted rooms with visible history. (#4738)
* feat: Add history visible alert. - Adds a dismissable alert that is displayed whenever the user opens a room with `history_visibility` != `joined`. When cleared, this is recorded in the app's data store. - When opening a room with `history_visibility` = `joined`, this flag is cleared. Issue: element-hq/element-meta#2875 * tests: Add unit tests for history sharing in `RoomScreenFooterView`. * feat: Rename flag to `hasSeenHistoryVisibleBannerRooms`, document. * refactor: Merge enum variants, use function for banner description. * feat: Use `AppSettings.historyVisibleDetailsURL` over hard-coded value. * tests: Correct potential race condition with deferred assertion. * chore: Use Localazy translation string over project-defined. * fix: Final tweaks and review comments. * chore: Checkout `Enterprise` submodule. * tests: Final fixes.
This commit is contained in:
@@ -32,6 +32,7 @@ final class AppSettings {
|
|||||||
case seenInvites
|
case seenInvites
|
||||||
case hasSeenSpacesAnnouncement
|
case hasSeenSpacesAnnouncement
|
||||||
case hasSeenNewSoundBanner
|
case hasSeenNewSoundBanner
|
||||||
|
case acknowledgedHistoryVisibleRooms
|
||||||
case appLockNumberOfPINAttempts
|
case appLockNumberOfPINAttempts
|
||||||
case appLockNumberOfBiometricAttempts
|
case appLockNumberOfBiometricAttempts
|
||||||
case timelineStyle
|
case timelineStyle
|
||||||
@@ -125,6 +126,7 @@ final class AppSettings {
|
|||||||
deviceVerificationURL: URL,
|
deviceVerificationURL: URL,
|
||||||
chatBackupDetailsURL: URL,
|
chatBackupDetailsURL: URL,
|
||||||
identityPinningViolationDetailsURL: URL,
|
identityPinningViolationDetailsURL: URL,
|
||||||
|
historyVisibleDetailsURL: URL,
|
||||||
elementWebHosts: [String],
|
elementWebHosts: [String],
|
||||||
accountProvisioningHost: String,
|
accountProvisioningHost: String,
|
||||||
bugReportApplicationID: String,
|
bugReportApplicationID: String,
|
||||||
@@ -144,6 +146,7 @@ final class AppSettings {
|
|||||||
self.deviceVerificationURL = deviceVerificationURL
|
self.deviceVerificationURL = deviceVerificationURL
|
||||||
self.chatBackupDetailsURL = chatBackupDetailsURL
|
self.chatBackupDetailsURL = chatBackupDetailsURL
|
||||||
self.identityPinningViolationDetailsURL = identityPinningViolationDetailsURL
|
self.identityPinningViolationDetailsURL = identityPinningViolationDetailsURL
|
||||||
|
self.historyVisibleDetailsURL = historyVisibleDetailsURL
|
||||||
self.elementWebHosts = elementWebHosts
|
self.elementWebHosts = elementWebHosts
|
||||||
self.accountProvisioningHost = accountProvisioningHost
|
self.accountProvisioningHost = accountProvisioningHost
|
||||||
self.bugReportApplicationID = bugReportApplicationID
|
self.bugReportApplicationID = bugReportApplicationID
|
||||||
@@ -171,6 +174,10 @@ final class AppSettings {
|
|||||||
@UserPreference(key: UserDefaultsKeys.hasSeenNewSoundBanner, defaultValue: true, storageType: .userDefaults(store))
|
@UserPreference(key: UserDefaultsKeys.hasSeenNewSoundBanner, defaultValue: true, storageType: .userDefaults(store))
|
||||||
var hasSeenNewSoundBanner
|
var hasSeenNewSoundBanner
|
||||||
|
|
||||||
|
/// The Set of room identifiers that the user has acknowledged have visible history.
|
||||||
|
@UserPreference(key: UserDefaultsKeys.acknowledgedHistoryVisibleRooms, defaultValue: [], storageType: .userDefaults(store))
|
||||||
|
var acknowledgedHistoryVisibleRooms: Set<String>
|
||||||
|
|
||||||
/// The initial set of account providers shown to the user in the authentication flow.
|
/// The initial set of account providers shown to the user in the authentication flow.
|
||||||
///
|
///
|
||||||
/// Account provider is the friendly term for the server name. It should not contain an `https` prefix and should
|
/// Account provider is the friendly term for the server name. It should not contain an `https` prefix and should
|
||||||
@@ -202,6 +209,8 @@ final class AppSettings {
|
|||||||
private(set) var chatBackupDetailsURL: URL = "https://element.io/help#encryption5"
|
private(set) var chatBackupDetailsURL: URL = "https://element.io/help#encryption5"
|
||||||
/// A URL where users can go read more about identity pinning violations
|
/// A URL where users can go read more about identity pinning violations
|
||||||
private(set) var identityPinningViolationDetailsURL: URL = "https://element.io/help#encryption18"
|
private(set) var identityPinningViolationDetailsURL: URL = "https://element.io/help#encryption18"
|
||||||
|
/// A URL where users can go to read more about room history sharing.
|
||||||
|
private(set) var historyVisibleDetailsURL: URL = "https://element.io/en/help#e2ee-history-sharing"
|
||||||
/// Any domains that Element web may be hosted on - used for handling links.
|
/// Any domains that Element web may be hosted on - used for handling links.
|
||||||
private(set) var elementWebHosts = ["app.element.io", "staging.element.io", "develop.element.io"]
|
private(set) var elementWebHosts = ["app.element.io", "staging.element.io", "develop.element.io"]
|
||||||
/// The domain that account provisioning links will be hosted on - used for handling the links.
|
/// The domain that account provisioning links will be hosted on - used for handling the links.
|
||||||
|
|||||||
@@ -93,11 +93,13 @@ struct RoomScreenViewStateBindings {
|
|||||||
enum RoomScreenFooterViewAction {
|
enum RoomScreenFooterViewAction {
|
||||||
case resolvePinViolation(userID: String)
|
case resolvePinViolation(userID: String)
|
||||||
case resolveVerificationViolation(userID: String)
|
case resolveVerificationViolation(userID: String)
|
||||||
|
case dismissHistoryVisibleAlert
|
||||||
}
|
}
|
||||||
|
|
||||||
enum RoomScreenFooterViewDetails {
|
enum RoomScreenFooterViewDetails {
|
||||||
case pinViolation(member: RoomMemberProxyProtocol, learnMoreURL: URL)
|
case pinViolation(member: RoomMemberProxyProtocol, learnMoreURL: URL)
|
||||||
case verificationViolation(member: RoomMemberProxyProtocol, learnMoreURL: URL)
|
case verificationViolation(member: RoomMemberProxyProtocol, learnMoreURL: URL)
|
||||||
|
case historyVisible(learnMoreURL: URL)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum PinnedEventsBannerState: Equatable {
|
enum PinnedEventsBannerState: Equatable {
|
||||||
|
|||||||
@@ -101,6 +101,9 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
|||||||
Task { await resolveIdentityPinningViolation(userID) }
|
Task { await resolveIdentityPinningViolation(userID) }
|
||||||
case .resolveVerificationViolation(let userID):
|
case .resolveVerificationViolation(let userID):
|
||||||
Task { await resolveIdentityVerificationViolation(userID) }
|
Task { await resolveIdentityVerificationViolation(userID) }
|
||||||
|
case .dismissHistoryVisibleAlert:
|
||||||
|
appSettings.acknowledgedHistoryVisibleRooms.insert(roomProxy.id)
|
||||||
|
state.footerDetails = nil
|
||||||
}
|
}
|
||||||
case .acceptKnock(let eventID):
|
case .acceptKnock(let eventID):
|
||||||
Task { await acceptKnock(eventID: eventID) }
|
Task { await acceptKnock(eventID: eventID) }
|
||||||
@@ -342,6 +345,16 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
|||||||
state.canDeclineKnocks = powerLevels.canOwnUserKick()
|
state.canDeclineKnocks = powerLevels.canOwnUserKick()
|
||||||
state.canBan = powerLevels.canOwnUserBan()
|
state.canBan = powerLevels.canOwnUserBan()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Whever the user opens a room with joined history visibility, we clear the dismiss flag to ensure that the banner is displayed again if the history is made visible in the future.
|
||||||
|
if roomInfo.historyVisibility == RoomHistoryVisibility.joined {
|
||||||
|
appSettings.acknowledgedHistoryVisibleRooms.remove(roomInfo.id)
|
||||||
|
state.footerDetails = nil
|
||||||
|
}
|
||||||
|
// Whenever the user opens an encrypted room with non-join history visbility, we show them a warning banner if they have not already dismissed it.
|
||||||
|
else if roomInfo.isEncrypted, !appSettings.acknowledgedHistoryVisibleRooms.contains(roomInfo.id) {
|
||||||
|
state.footerDetails = .historyVisible(learnMoreURL: appSettings.historyVisibleDetailsURL)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func setupPinnedEventsTimelineItemProviderIfNeeded() {
|
private func setupPinnedEventsTimelineItemProviderIfNeeded() {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ struct RoomScreenFooterView: View {
|
|||||||
|
|
||||||
private var borderColor: Color {
|
private var borderColor: Color {
|
||||||
switch details {
|
switch details {
|
||||||
case .pinViolation:
|
case .pinViolation, .historyVisible:
|
||||||
.compound.borderInfoSubtle
|
.compound.borderInfoSubtle
|
||||||
case .verificationViolation:
|
case .verificationViolation:
|
||||||
.compound.borderCriticalSubtle
|
.compound.borderCriticalSubtle
|
||||||
@@ -27,7 +27,7 @@ struct RoomScreenFooterView: View {
|
|||||||
|
|
||||||
private var gradient: Gradient {
|
private var gradient: Gradient {
|
||||||
switch details {
|
switch details {
|
||||||
case .pinViolation:
|
case .pinViolation, .historyVisible:
|
||||||
.compound.info
|
.compound.info
|
||||||
case .verificationViolation:
|
case .verificationViolation:
|
||||||
Gradient(colors: [.compound.bgCriticalSubtle, .clear])
|
Gradient(colors: [.compound.bgCriticalSubtle, .clear])
|
||||||
@@ -54,6 +54,8 @@ struct RoomScreenFooterView: View {
|
|||||||
pinViolation(member: member, learnMoreURL: learnMoreURL)
|
pinViolation(member: member, learnMoreURL: learnMoreURL)
|
||||||
case .verificationViolation(member: let member, learnMoreURL: let learnMoreURL):
|
case .verificationViolation(member: let member, learnMoreURL: let learnMoreURL):
|
||||||
verificationViolation(member: member, learnMoreURL: learnMoreURL)
|
verificationViolation(member: member, learnMoreURL: learnMoreURL)
|
||||||
|
case .historyVisible(learnMoreURL: let learnMoreURL):
|
||||||
|
historyVisibleAlert(learnMoreURL: learnMoreURL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,10 +153,43 @@ struct RoomScreenFooterView: View {
|
|||||||
return description
|
return description
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func historyVisibleAlertDescriptionWithLearnMoreLink(learnMoreURL: URL) -> AttributedString {
|
||||||
|
let linkPlaceholder = "{link}"
|
||||||
|
var description = AttributedString(L10n.cryptoHistoryVisible(linkPlaceholder))
|
||||||
|
var linkString = AttributedString(L10n.actionLearnMore)
|
||||||
|
linkString.link = learnMoreURL
|
||||||
|
linkString.bold()
|
||||||
|
description.replace(linkPlaceholder, with: linkString)
|
||||||
|
return description
|
||||||
|
}
|
||||||
|
|
||||||
private func fallbackDisplayName(_ userID: String) -> String {
|
private func fallbackDisplayName(_ userID: String) -> String {
|
||||||
guard let localpart = userID.components(separatedBy: ":").first else { return userID }
|
guard let localpart = userID.components(separatedBy: ":").first else { return userID }
|
||||||
return String(localpart.trimmingPrefix("@"))
|
return String(localpart.trimmingPrefix("@"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func historyVisibleAlert(learnMoreURL: URL) -> some View {
|
||||||
|
let description = historyVisibleAlertDescriptionWithLearnMoreLink(learnMoreURL: learnMoreURL)
|
||||||
|
|
||||||
|
return VStack(spacing: 16) {
|
||||||
|
HStack(spacing: 16) {
|
||||||
|
CompoundIcon(\.info).foregroundColor(.compound.iconInfoPrimary)
|
||||||
|
Text(description)
|
||||||
|
.font(.compound.bodyMD)
|
||||||
|
.foregroundColor(.compound.textInfoPrimary)
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
callback(.dismissHistoryVisibleAlert)
|
||||||
|
} label: {
|
||||||
|
Text(L10n.actionDismiss)
|
||||||
|
.frame(maxWidth: .infinity)
|
||||||
|
}
|
||||||
|
.buttonStyle(.compound(.primary, size: .medium))
|
||||||
|
}
|
||||||
|
.padding(.top, 16)
|
||||||
|
.padding(.horizontal, 16)
|
||||||
|
.padding(.bottom, 8)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct RoomScreenFooterView_Previews: PreviewProvider, TestablePreview {
|
struct RoomScreenFooterView_Previews: PreviewProvider, TestablePreview {
|
||||||
@@ -166,6 +201,8 @@ struct RoomScreenFooterView_Previews: PreviewProvider, TestablePreview {
|
|||||||
static let verificationViolationDetails: RoomScreenFooterViewDetails = .verificationViolation(member: RoomMemberProxyMock.mockBob,
|
static let verificationViolationDetails: RoomScreenFooterViewDetails = .verificationViolation(member: RoomMemberProxyMock.mockBob,
|
||||||
learnMoreURL: "https://element.io/")
|
learnMoreURL: "https://element.io/")
|
||||||
|
|
||||||
|
static let historyVisibleDetails: RoomScreenFooterViewDetails = .historyVisible(learnMoreURL: "https://element.io")
|
||||||
|
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
RoomScreenFooterView(details: bobDetails, mediaProvider: MediaProviderMock(configuration: .init())) { _ in }
|
RoomScreenFooterView(details: bobDetails, mediaProvider: MediaProviderMock(configuration: .init())) { _ in }
|
||||||
.previewDisplayName("With displayname")
|
.previewDisplayName("With displayname")
|
||||||
@@ -173,5 +210,6 @@ struct RoomScreenFooterView_Previews: PreviewProvider, TestablePreview {
|
|||||||
.previewDisplayName("Without displayname")
|
.previewDisplayName("Without displayname")
|
||||||
RoomScreenFooterView(details: verificationViolationDetails, mediaProvider: MediaProviderMock(configuration: .init())) { _ in }
|
RoomScreenFooterView(details: verificationViolationDetails, mediaProvider: MediaProviderMock(configuration: .init())) { _ in }
|
||||||
.previewDisplayName("Verification Violation")
|
.previewDisplayName("Verification Violation")
|
||||||
|
RoomScreenFooterView(details: historyVisibleDetails, mediaProvider: MediaProviderMock(configuration: .init())) { _ in }.previewDisplayName("History Visible")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ class MockScreen: Identifiable {
|
|||||||
deviceVerificationURL: appSettings.deviceVerificationURL,
|
deviceVerificationURL: appSettings.deviceVerificationURL,
|
||||||
chatBackupDetailsURL: appSettings.chatBackupDetailsURL,
|
chatBackupDetailsURL: appSettings.chatBackupDetailsURL,
|
||||||
identityPinningViolationDetailsURL: appSettings.identityPinningViolationDetailsURL,
|
identityPinningViolationDetailsURL: appSettings.identityPinningViolationDetailsURL,
|
||||||
|
historyVisibleDetailsURL: appSettings.historyVisibleDetailsURL,
|
||||||
elementWebHosts: appSettings.elementWebHosts,
|
elementWebHosts: appSettings.elementWebHosts,
|
||||||
accountProvisioningHost: appSettings.accountProvisioningHost,
|
accountProvisioningHost: appSettings.accountProvisioningHost,
|
||||||
bugReportApplicationID: appSettings.bugReportApplicationID,
|
bugReportApplicationID: appSettings.bugReportApplicationID,
|
||||||
|
|||||||
+1
-1
Submodule Enterprise updated: e2c37065c6...6fafddc467
@@ -172,6 +172,7 @@ class AuthenticationStartScreenViewModelTests: XCTestCase {
|
|||||||
deviceVerificationURL: appSettings.deviceVerificationURL,
|
deviceVerificationURL: appSettings.deviceVerificationURL,
|
||||||
chatBackupDetailsURL: appSettings.chatBackupDetailsURL,
|
chatBackupDetailsURL: appSettings.chatBackupDetailsURL,
|
||||||
identityPinningViolationDetailsURL: appSettings.identityPinningViolationDetailsURL,
|
identityPinningViolationDetailsURL: appSettings.identityPinningViolationDetailsURL,
|
||||||
|
historyVisibleDetailsURL: appSettings.historyVisibleDetailsURL,
|
||||||
elementWebHosts: appSettings.elementWebHosts,
|
elementWebHosts: appSettings.elementWebHosts,
|
||||||
accountProvisioningHost: appSettings.accountProvisioningHost,
|
accountProvisioningHost: appSettings.accountProvisioningHost,
|
||||||
bugReportApplicationID: appSettings.bugReportApplicationID,
|
bugReportApplicationID: appSettings.bugReportApplicationID,
|
||||||
|
|||||||
@@ -438,4 +438,118 @@ class RoomScreenViewModelTests: XCTestCase {
|
|||||||
}
|
}
|
||||||
try await deferred.fulfill()
|
try await deferred.fulfill()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: History Sharing
|
||||||
|
|
||||||
|
func testHistoryVisibleBannerDoesNotAppearIfNotEncrypted() async throws {
|
||||||
|
let roomProxyMock = JoinedRoomProxyMock(.init(isEncrypted: false))
|
||||||
|
|
||||||
|
let viewModel = RoomScreenViewModel(userSession: UserSessionMock(.init()),
|
||||||
|
roomProxy: roomProxyMock,
|
||||||
|
initialSelectedPinnedEventID: nil,
|
||||||
|
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||||
|
appSettings: ServiceLocator.shared.settings,
|
||||||
|
appHooks: AppHooks(),
|
||||||
|
analyticsService: ServiceLocator.shared.analytics,
|
||||||
|
userIndicatorController: ServiceLocator.shared.userIndicatorController)
|
||||||
|
|
||||||
|
self.viewModel = viewModel
|
||||||
|
|
||||||
|
let deferred = deferFulfillment(viewModel.context.$viewState) { state in
|
||||||
|
state.footerDetails == nil
|
||||||
|
}
|
||||||
|
try await deferred.fulfill()
|
||||||
|
}
|
||||||
|
|
||||||
|
func testHistoryVisibleBannerDoesNotAppearIfJoined() async throws {
|
||||||
|
let configuration = JoinedRoomProxyMockConfiguration(isEncrypted: false)
|
||||||
|
let roomProxyMock = JoinedRoomProxyMock(configuration)
|
||||||
|
|
||||||
|
let roomInfoProxyMock = RoomInfoProxyMock(configuration)
|
||||||
|
roomInfoProxyMock.historyVisibility = .joined
|
||||||
|
|
||||||
|
let infoSubject = CurrentValueSubject<RoomInfoProxyProtocol, Never>(roomInfoProxyMock)
|
||||||
|
roomProxyMock.underlyingInfoPublisher = infoSubject.asCurrentValuePublisher()
|
||||||
|
|
||||||
|
let viewModel = RoomScreenViewModel(userSession: UserSessionMock(.init()),
|
||||||
|
roomProxy: roomProxyMock,
|
||||||
|
initialSelectedPinnedEventID: nil,
|
||||||
|
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||||
|
appSettings: ServiceLocator.shared.settings,
|
||||||
|
appHooks: AppHooks(),
|
||||||
|
analyticsService: ServiceLocator.shared.analytics,
|
||||||
|
userIndicatorController: ServiceLocator.shared.userIndicatorController)
|
||||||
|
|
||||||
|
self.viewModel = viewModel
|
||||||
|
|
||||||
|
let deferred = deferFulfillment(viewModel.context.$viewState) { state in
|
||||||
|
state.footerDetails == nil
|
||||||
|
}
|
||||||
|
try await deferred.fulfill()
|
||||||
|
}
|
||||||
|
|
||||||
|
func testHistoryVisibleBannerDoesNotAppearIfAcknowledged() async throws {
|
||||||
|
ServiceLocator.shared.settings.acknowledgedHistoryVisibleRooms.insert("$room:example.com")
|
||||||
|
|
||||||
|
let configuration = JoinedRoomProxyMockConfiguration(id: "$room:example.com", isEncrypted: false)
|
||||||
|
let roomProxyMock = JoinedRoomProxyMock(configuration)
|
||||||
|
|
||||||
|
let roomInfoProxyMock = RoomInfoProxyMock(configuration)
|
||||||
|
roomInfoProxyMock.historyVisibility = .shared
|
||||||
|
|
||||||
|
let infoSubject = CurrentValueSubject<RoomInfoProxyProtocol, Never>(roomInfoProxyMock)
|
||||||
|
roomProxyMock.underlyingInfoPublisher = infoSubject.asCurrentValuePublisher()
|
||||||
|
|
||||||
|
let viewModel = RoomScreenViewModel(userSession: UserSessionMock(.init()),
|
||||||
|
roomProxy: roomProxyMock,
|
||||||
|
initialSelectedPinnedEventID: nil,
|
||||||
|
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||||
|
appSettings: ServiceLocator.shared.settings,
|
||||||
|
appHooks: AppHooks(),
|
||||||
|
analyticsService: ServiceLocator.shared.analytics,
|
||||||
|
userIndicatorController: ServiceLocator.shared.userIndicatorController)
|
||||||
|
|
||||||
|
self.viewModel = viewModel
|
||||||
|
|
||||||
|
let deferred = deferFulfillment(viewModel.context.$viewState) { state in
|
||||||
|
state.footerDetails == nil
|
||||||
|
}
|
||||||
|
try await deferred.fulfill()
|
||||||
|
}
|
||||||
|
|
||||||
|
func testHistoryVisibleBannerAppearsThenDisappearsOnAcknowledge() async throws {
|
||||||
|
let configuration = JoinedRoomProxyMockConfiguration(id: "$room:example.com", isEncrypted: true)
|
||||||
|
let roomProxyMock = JoinedRoomProxyMock(configuration)
|
||||||
|
|
||||||
|
let roomInfoProxyMock = RoomInfoProxyMock(configuration)
|
||||||
|
roomInfoProxyMock.historyVisibility = .shared
|
||||||
|
|
||||||
|
let infoSubject = CurrentValueSubject<RoomInfoProxyProtocol, Never>(roomInfoProxyMock)
|
||||||
|
roomProxyMock.underlyingInfoPublisher = infoSubject.asCurrentValuePublisher()
|
||||||
|
|
||||||
|
let viewModel = RoomScreenViewModel(userSession: UserSessionMock(.init()),
|
||||||
|
roomProxy: roomProxyMock,
|
||||||
|
initialSelectedPinnedEventID: nil,
|
||||||
|
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||||
|
appSettings: ServiceLocator.shared.settings,
|
||||||
|
appHooks: AppHooks(),
|
||||||
|
analyticsService: ServiceLocator.shared.analytics,
|
||||||
|
userIndicatorController: ServiceLocator.shared.userIndicatorController)
|
||||||
|
|
||||||
|
self.viewModel = viewModel
|
||||||
|
|
||||||
|
var deferred = deferFulfillment(viewModel.context.$viewState) { state in
|
||||||
|
state.footerDetails != nil
|
||||||
|
}
|
||||||
|
try await deferred.fulfill()
|
||||||
|
|
||||||
|
deferred = deferFulfillment(viewModel.context.$viewState) { state in
|
||||||
|
state.footerDetails == nil
|
||||||
|
}
|
||||||
|
|
||||||
|
ServiceLocator.shared.settings.acknowledgedHistoryVisibleRooms.insert("$room:example.com")
|
||||||
|
viewModel.context.send(viewAction: .footerViewAction(RoomScreenFooterViewAction.dismissHistoryVisibleAlert))
|
||||||
|
|
||||||
|
try await deferred.fulfill()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -324,6 +324,7 @@ class ServerConfirmationScreenViewModelTests: XCTestCase {
|
|||||||
deviceVerificationURL: appSettings.deviceVerificationURL,
|
deviceVerificationURL: appSettings.deviceVerificationURL,
|
||||||
chatBackupDetailsURL: appSettings.chatBackupDetailsURL,
|
chatBackupDetailsURL: appSettings.chatBackupDetailsURL,
|
||||||
identityPinningViolationDetailsURL: appSettings.identityPinningViolationDetailsURL,
|
identityPinningViolationDetailsURL: appSettings.identityPinningViolationDetailsURL,
|
||||||
|
historyVisibleDetailsURL: appSettings.historyVisibleDetailsURL,
|
||||||
elementWebHosts: appSettings.elementWebHosts,
|
elementWebHosts: appSettings.elementWebHosts,
|
||||||
accountProvisioningHost: appSettings.accountProvisioningHost,
|
accountProvisioningHost: appSettings.accountProvisioningHost,
|
||||||
bugReportApplicationID: appSettings.bugReportApplicationID,
|
bugReportApplicationID: appSettings.bugReportApplicationID,
|
||||||
|
|||||||
Reference in New Issue
Block a user