Fixes #1699 - Introduce a new advanced settings screen (#1700)

This commit is contained in:
Stefan Ceriu
2023-09-14 08:37:42 +03:00
committed by GitHub
parent 21856e994a
commit 761d508ae5
18 changed files with 309 additions and 75 deletions
@@ -29,15 +29,12 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
self.userSession = userSession
self.appSettings = appSettings
let bindings = SettingsScreenViewStateBindings(timelineStyle: appSettings.timelineStyle)
var showSessionVerificationSection = false
if let sessionVerificationController = userSession.sessionVerificationController {
showSessionVerificationSection = !sessionVerificationController.isVerified
}
super.init(initialViewState: .init(bindings: bindings,
deviceID: userSession.deviceID,
super.init(initialViewState: .init(deviceID: userSession.deviceID,
userID: userSession.userID,
accountProfileURL: userSession.clientProxy.accountURL(action: .profile),
accountSessionsListURL: userSession.clientProxy.accountURL(action: .sessionsList),
@@ -45,10 +42,6 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
showDeveloperOptions: appSettings.canShowDeveloperOptions),
imageProvider: userSession.mediaProvider)
appSettings.$timelineStyle
.weakAssign(to: \.state.bindings.timelineStyle, on: self)
.store(in: &cancellables)
userSession.clientProxy.avatarURLPublisher
.weakAssign(to: \.state.userAvatarURL, on: self)
.store(in: &cancellables)
@@ -94,12 +87,12 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
callback?(.logout)
case .sessionVerification:
callback?(.sessionVerification)
case .changedTimelineStyle:
appSettings.timelineStyle = state.bindings.timelineStyle
case .notifications:
callback?(.notifications)
case .accountSessionsList:
callback?(.accountSessionsList)
case .advancedSettings:
callback?(.advancedSettings)
case .developerOptions:
callback?(.developerOptions)