mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Removed unused swipe gesture (+3 squashed commits)
Squashed commits: [d64bb3bb] Stop using the ServiceLocator directly in the ScreenTrackerViewModifier [37c46ab9] Rename Analytics to AnalyticsService [8852a371] #920 - Cleanup ServiceLocator usages
This commit is contained in:
committed by
Stefan Ceriu
parent
b4cd58b209
commit
e6711a0236
@@ -21,12 +21,15 @@ typealias SettingsScreenViewModelType = StateStoreViewModel<SettingsScreenViewSt
|
||||
|
||||
class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewModelProtocol {
|
||||
private let userSession: UserSessionProtocol
|
||||
private let appSettings: AppSettings
|
||||
|
||||
var callback: ((SettingsScreenViewModelAction) -> Void)?
|
||||
|
||||
init(withUserSession userSession: UserSessionProtocol) {
|
||||
init(userSession: UserSessionProtocol, appSettings: AppSettings) {
|
||||
self.userSession = userSession
|
||||
let bindings = SettingsScreenViewStateBindings(timelineStyle: ServiceLocator.shared.settings.timelineStyle)
|
||||
self.appSettings = appSettings
|
||||
|
||||
let bindings = SettingsScreenViewStateBindings(timelineStyle: appSettings.timelineStyle)
|
||||
|
||||
var showSessionVerificationSection = false
|
||||
if let sessionVerificationController = userSession.sessionVerificationController {
|
||||
@@ -37,10 +40,10 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
|
||||
deviceID: userSession.deviceID,
|
||||
userID: userSession.userID,
|
||||
showSessionVerificationSection: showSessionVerificationSection,
|
||||
showDeveloperOptions: ServiceLocator.shared.settings.canShowDeveloperOptions),
|
||||
showDeveloperOptions: appSettings.canShowDeveloperOptions),
|
||||
imageProvider: userSession.mediaProvider)
|
||||
|
||||
ServiceLocator.shared.settings.$timelineStyle
|
||||
appSettings.$timelineStyle
|
||||
.weakAssign(to: \.state.bindings.timelineStyle, on: self)
|
||||
.store(in: &cancellables)
|
||||
|
||||
@@ -88,7 +91,7 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
|
||||
case .sessionVerification:
|
||||
callback?(.sessionVerification)
|
||||
case .changedTimelineStyle:
|
||||
ServiceLocator.shared.settings.timelineStyle = state.bindings.timelineStyle
|
||||
appSettings.timelineStyle = state.bindings.timelineStyle
|
||||
case .developerOptions:
|
||||
callback?(.developerOptions)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user