mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Remove the dynamic member lookup from UserSettings in favour of nested access. (#6294)
* Remove the dynamic member lookup from UserSettings in favour of nested access. * Remove forwarding methods from UserSettings. * Update the Enterprise submodule.
This commit is contained in:
@@ -94,7 +94,7 @@ class OnboardingFlowCoordinator: FlowCoordinatorProtocol {
|
||||
value == .verified,
|
||||
stateMachine.state == .identityConfirmation else { return }
|
||||
|
||||
userSettings.hasRunIdentityConfirmationOnboarding = true
|
||||
userSettings.account.hasRunIdentityConfirmationOnboarding = true
|
||||
stateMachine.tryEvent(.nextSkippingIdentityConfirmed)
|
||||
}
|
||||
}
|
||||
@@ -129,11 +129,11 @@ class OnboardingFlowCoordinator: FlowCoordinatorProtocol {
|
||||
|
||||
private var requiresVerification: Bool {
|
||||
// We want to make sure onboarding finishes but also every time the user becomes unverified (e.g. account reset)
|
||||
!userSettings.hasRunIdentityConfirmationOnboarding || userSession.sessionSecurityStatePublisher.value.verificationState == .unverified
|
||||
!userSettings.account.hasRunIdentityConfirmationOnboarding || userSession.sessionSecurityStatePublisher.value.verificationState == .unverified
|
||||
}
|
||||
|
||||
private var requiresAppLockSetup: Bool {
|
||||
userSettings.appLockIsMandatory && !appLockService.isEnabled
|
||||
userSettings.app.appLockIsMandatory && !appLockService.isEnabled
|
||||
}
|
||||
|
||||
private var requiresAnalyticsSetup: Bool {
|
||||
@@ -141,7 +141,7 @@ class OnboardingFlowCoordinator: FlowCoordinatorProtocol {
|
||||
}
|
||||
|
||||
private var requiresNotificationsSetup: Bool {
|
||||
!userSettings.hasRunNotificationPermissionsOnboarding
|
||||
!userSettings.app.hasRunNotificationPermissionsOnboarding
|
||||
}
|
||||
|
||||
private func configureStateMachine() {
|
||||
@@ -225,7 +225,7 @@ class OnboardingFlowCoordinator: FlowCoordinatorProtocol {
|
||||
presentNotificationPermissionsScreen()
|
||||
case (_, _, .finished):
|
||||
isNewLogin = false
|
||||
userSettings.hasSignedInBefore = true
|
||||
userSettings.app.hasSignedInBefore = true
|
||||
actionsSubject.send(.dismiss)
|
||||
stateMachine.tryState(.initial)
|
||||
case (.finished, _, .initial):
|
||||
@@ -261,7 +261,7 @@ class OnboardingFlowCoordinator: FlowCoordinatorProtocol {
|
||||
case .recoveryKey:
|
||||
presentRecoveryKeyScreen()
|
||||
case .skip:
|
||||
userSettings.hasRunIdentityConfirmationOnboarding = true
|
||||
userSettings.account.hasRunIdentityConfirmationOnboarding = true
|
||||
stateMachine.tryEvent(.nextSkippingIdentityConfirmed)
|
||||
case .reset:
|
||||
startEncryptionResetFlow()
|
||||
@@ -384,7 +384,7 @@ class OnboardingFlowCoordinator: FlowCoordinatorProtocol {
|
||||
}
|
||||
|
||||
private func presentAnalyticsPromptScreen() {
|
||||
let coordinator = AnalyticsPromptScreenCoordinator(analytics: analyticsService, termsURL: userSettings.analyticsTermsURL)
|
||||
let coordinator = AnalyticsPromptScreenCoordinator(analytics: analyticsService, termsURL: userSettings.app.analyticsTermsURL)
|
||||
|
||||
coordinator.actions
|
||||
.sink { [weak self] action in
|
||||
@@ -407,7 +407,7 @@ class OnboardingFlowCoordinator: FlowCoordinatorProtocol {
|
||||
guard let self else { return }
|
||||
switch action {
|
||||
case .done:
|
||||
userSettings.hasRunNotificationPermissionsOnboarding = true
|
||||
userSettings.app.hasRunNotificationPermissionsOnboarding = true
|
||||
stateMachine.tryEvent(.next)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ class PinnedEventsTimelineFlowCoordinator: FlowCoordinatorProtocol {
|
||||
let stackCoordinator = NavigationStackCoordinator()
|
||||
|
||||
let params = LocationSharingScreenCoordinatorParameters(interactionMode: interactionMode,
|
||||
mapURLBuilder: flowParameters.userSettings.mapTilerConfiguration.publisher.value,
|
||||
mapURLBuilder: flowParameters.userSettings.app.mapTilerConfiguration.publisher.value,
|
||||
roomProxy: roomProxy,
|
||||
timelineController: timelineController,
|
||||
liveLocationManager: flowParameters.userSession.liveLocationManager,
|
||||
|
||||
@@ -238,7 +238,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
||||
defer { hideLoadingIndicator() }
|
||||
switch await roomProxy.loadOrFetchEventDetails(for: eventID) {
|
||||
case .success(let event):
|
||||
if flowParameters.userSettings.threadsEnabled, let threadRootEventID = event.threadRootEventId() {
|
||||
if flowParameters.userSettings.app.threadsEnabled, let threadRootEventID = event.threadRootEventId() {
|
||||
if case .thread(threadRootEventID: threadRootEventID, _) = stateMachine.state, let threadCoordinator = childThreadScreenCoordinators.last {
|
||||
threadCoordinator.focusOnEvent(eventID: eventID)
|
||||
} else {
|
||||
@@ -318,7 +318,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
||||
// Otherwise check if the focussed event exists to handle a possible error or theaded event.
|
||||
switch await roomProxy.loadOrFetchEventDetails(for: focusEvent.eventID) {
|
||||
case .success(let event):
|
||||
if flowParameters.userSettings.threadsEnabled, let threadRootEventID = event.threadRootEventId() {
|
||||
if flowParameters.userSettings.app.threadsEnabled, let threadRootEventID = event.threadRootEventId() {
|
||||
stateMachine.tryEvent(.presentRoom(presentationAction: .thread(rootEventID: threadRootEventID,
|
||||
focusEvent: .init(eventID: focusEvent.eventID,
|
||||
shouldSetPin: focusEvent.shouldSetPin))),
|
||||
@@ -1119,8 +1119,8 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
||||
let parameters = MediaUploadPreviewScreenCoordinatorParameters(mediaURLs: mediaURLs,
|
||||
caption: caption,
|
||||
title: title,
|
||||
shouldShowCaptionWarning: flowParameters.userSettings.shouldShowMediaCaptionWarning,
|
||||
galleryEnabled: flowParameters.userSettings.galleryEnabled,
|
||||
shouldShowCaptionWarning: flowParameters.userSettings.app.shouldShowMediaCaptionWarning,
|
||||
galleryEnabled: flowParameters.userSettings.app.galleryEnabled,
|
||||
mediaUploadingPreprocessor: MediaUploadingPreprocessor(userSettings: flowParameters.userSettings),
|
||||
timelineController: timelineController,
|
||||
clientProxy: userSession.clientProxy,
|
||||
@@ -1176,7 +1176,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
||||
let stackCoordinator = NavigationStackCoordinator()
|
||||
|
||||
let params = LocationSharingScreenCoordinatorParameters(interactionMode: interactionMode,
|
||||
mapURLBuilder: flowParameters.userSettings.mapTilerConfiguration.publisher.value,
|
||||
mapURLBuilder: flowParameters.userSettings.app.mapTilerConfiguration.publisher.value,
|
||||
roomProxy: roomProxy,
|
||||
timelineController: timelineController,
|
||||
liveLocationManager: flowParameters.userSession.liveLocationManager,
|
||||
|
||||
@@ -264,7 +264,7 @@ class SettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
}
|
||||
|
||||
private func presentBlockedUsersScreen() {
|
||||
let coordinator = BlockedUsersScreenCoordinator(parameters: .init(hideProfiles: flowParameters.userSettings.hideIgnoredUserProfiles,
|
||||
let coordinator = BlockedUsersScreenCoordinator(parameters: .init(hideProfiles: flowParameters.userSettings.app.hideIgnoredUserProfiles,
|
||||
userSession: flowParameters.userSession,
|
||||
userIndicatorController: flowParameters.userIndicatorController))
|
||||
navigationStackCoordinator.push(coordinator)
|
||||
|
||||
@@ -87,19 +87,19 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
navigationTabCoordinator = NavigationTabCoordinator()
|
||||
navigationRootCoordinator.setRootCoordinator(navigationTabCoordinator)
|
||||
|
||||
let chatsSplitCoordinator = NavigationSplitCoordinator(placeholderCoordinator: PlaceholderScreenCoordinator(hideBrandChrome: flowParameters.userSettings.hideBrandChrome))
|
||||
let chatsSplitCoordinator = NavigationSplitCoordinator(placeholderCoordinator: PlaceholderScreenCoordinator(hideBrandChrome: flowParameters.userSettings.app.hideBrandChrome))
|
||||
chatsTabFlowCoordinator = ChatsTabFlowCoordinator(navigationSplitCoordinator: chatsSplitCoordinator,
|
||||
flowParameters: flowParameters)
|
||||
chatsTabDetails = .init(tag: HomeTab.chats, title: L10n.screenHomeTabChats, icon: \.chat, selectedIcon: \.chatSolid)
|
||||
chatsTabDetails.navigationSplitCoordinator = chatsSplitCoordinator
|
||||
|
||||
let spacesSplitCoordinator = NavigationSplitCoordinator(placeholderCoordinator: PlaceholderScreenCoordinator(hideBrandChrome: flowParameters.userSettings.hideBrandChrome))
|
||||
let spacesSplitCoordinator = NavigationSplitCoordinator(placeholderCoordinator: PlaceholderScreenCoordinator(hideBrandChrome: flowParameters.userSettings.app.hideBrandChrome))
|
||||
spacesTabFlowCoordinator = SpacesTabFlowCoordinator(navigationSplitCoordinator: spacesSplitCoordinator,
|
||||
flowParameters: flowParameters)
|
||||
spacesTabDetails = .init(tag: HomeTab.spaces, title: L10n.screenHomeTabSpaces, icon: \.space, selectedIcon: \.spaceSolid)
|
||||
spacesTabDetails.navigationSplitCoordinator = spacesSplitCoordinator
|
||||
|
||||
if flowParameters.userSettings.globalSearchEnabled, #available(iOS 26.0, *) {
|
||||
if flowParameters.userSettings.app.globalSearchEnabled, #available(iOS 26.0, *) {
|
||||
let searchCoordinator = SearchScreenCoordinator(parameters: .init(roomSummaryProvider: flowParameters.userSession.clientProxy.alternateRoomSummaryProvider,
|
||||
clientProxy: flowParameters.userSession.clientProxy,
|
||||
mediaProvider: flowParameters.userSession.mediaProvider,
|
||||
@@ -463,8 +463,8 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
presentCallScreen(configuration: .init(roomProxy: roomProxy,
|
||||
clientProxy: userSession.clientProxy,
|
||||
clientID: InfoPlistReader.main.bundleIdentifier,
|
||||
elementCallBaseURL: flowParameters.userSettings.elementCallBaseURL,
|
||||
elementCallBaseURLOverride: flowParameters.userSettings.elementCallBaseURLOverride,
|
||||
elementCallBaseURL: flowParameters.userSettings.app.elementCallBaseURL,
|
||||
elementCallBaseURLOverride: flowParameters.userSettings.app.elementCallBaseURLOverride,
|
||||
voiceOnly: voiceOnly,
|
||||
colorScheme: colorScheme))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user