Replace AppSettings with UserSettings from the UserSessionFlow and below.

Remove some redundant injections when passed alongside a user session too.

# Conflicts:
#	ElementX/Sources/Screens/PinnedEventsTimelineScreen/View/PinnedEventsTimelineScreen.swift
#	ElementX/Sources/Screens/Timeline/TimelineViewModel.swift
This commit is contained in:
Doug
2026-09-25 13:51:33 +01:00
committed by Stefan Ceriu
parent 54cc1cba60
commit fccad5fc30
117 changed files with 554 additions and 594 deletions
@@ -14,7 +14,7 @@ struct CallScreenCoordinatorParameters {
let elementCallService: ElementCallServiceProtocol
let configuration: ElementCallConfiguration
let allowPictureInPicture: Bool
let appSettings: AppSettings
let userSettings: UserSettings
let analytics: AnalyticsServiceProtocol
}
@@ -45,7 +45,7 @@ final class CallScreenCoordinator: CoordinatorProtocol {
viewModel = CallScreenViewModel(elementCallService: parameters.elementCallService,
configuration: parameters.configuration,
allowPictureInPicture: parameters.allowPictureInPicture,
appSettings: parameters.appSettings,
userSettings: parameters.userSettings,
analyticsService: parameters.analytics)
}
@@ -17,7 +17,7 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
private let elementCallService: ElementCallServiceProtocol
private let configuration: ElementCallConfiguration
private let isPictureInPictureAllowed: Bool
private let appSettings: AppSettings
private let userSettings: UserSettings
private let analyticsService: AnalyticsServiceProtocol
private let widgetDriver: ElementCallWidgetDriverProtocol
@@ -39,11 +39,11 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
init(elementCallService: ElementCallServiceProtocol,
configuration: ElementCallConfiguration,
allowPictureInPicture: Bool,
appSettings: AppSettings,
userSettings: UserSettings,
analyticsService: AnalyticsServiceProtocol) {
self.elementCallService = elementCallService
self.configuration = configuration
self.appSettings = appSettings
self.userSettings = userSettings
self.analyticsService = analyticsService
isPictureInPictureAllowed = allowPictureInPicture
@@ -165,13 +165,13 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
// We only set the analytics configuration if analytics are enabled
let analyticsConfiguration: ElementCallAnalyticsConfiguration? = if analyticsService.isEnabled {
.init(posthogAPIHost: appSettings.elementCallPosthogAPIHost,
posthogAPIKey: appSettings.elementCallPosthogAPIKey,
sentryDSN: appSettings.elementCallPosthogSentryDSN)
.init(posthogAPIHost: userSettings.elementCallPosthogAPIHost,
posthogAPIKey: userSettings.elementCallPosthogAPIKey,
sentryDSN: userSettings.elementCallPosthogSentryDSN)
} else {
nil
}
let rageshakeURL: String? = if case let .url(baseURL) = appSettings.bugReportRageshakeURL.publisher.value {
let rageshakeURL: String? = if case let .url(baseURL) = userSettings.bugReportRageshakeURL.publisher.value {
baseURL.absoluteString
} else {
nil
@@ -405,7 +405,7 @@ struct CallScreen_Previews: PreviewProvider {
voiceOnly: false,
colorScheme: .light),
allowPictureInPicture: false,
appSettings: .volatile(),
userSettings: .volatile(),
analyticsService: AnalyticsServiceMock(.init()))
}
}