diff --git a/ElementX/Sources/Screens/Settings/SettingsScreenViewModel.swift b/ElementX/Sources/Screens/Settings/SettingsScreenViewModel.swift index 35f33e5f1..38aad95ac 100644 --- a/ElementX/Sources/Screens/Settings/SettingsScreenViewModel.swift +++ b/ElementX/Sources/Screens/Settings/SettingsScreenViewModel.swift @@ -27,10 +27,16 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo init(withUserSession userSession: UserSessionProtocol) { self.userSession = userSession let bindings = SettingsScreenViewStateBindings(timelineStyle: ServiceLocator.shared.settings.timelineStyle) + + var showSessionVerificationSection = false + if let sessionVerificationController = userSession.sessionVerificationController { + showSessionVerificationSection = !sessionVerificationController.isVerified + } + super.init(initialViewState: .init(bindings: bindings, deviceID: userSession.deviceID, userID: userSession.userID, - showSessionVerificationSection: !(userSession.sessionVerificationController?.isVerified ?? false), + showSessionVerificationSection: showSessionVerificationSection, showDeveloperOptions: ServiceLocator.shared.settings.canShowDeveloperOptions), imageProvider: userSession.mediaProvider) diff --git a/changelog.d/pr-650.bugfix b/changelog.d/pr-650.bugfix new file mode 100644 index 000000000..03f894086 --- /dev/null +++ b/changelog.d/pr-650.bugfix @@ -0,0 +1 @@ +Fixed crash on the settings screen when showing the "complete verification" button before the session verification controller proxy was ready \ No newline at end of file