From 4f03acab0cf3d36e4f72d6af039f0420d1a398c0 Mon Sep 17 00:00:00 2001 From: Mauro <34335419+Velin92@users.noreply.github.com> Date: Wed, 22 Jul 2026 11:40:27 +0200 Subject: [PATCH] Add signed in flag to the developer options screen hook (#5914) add signed in flag to the developer options screen hook --- .../Sources/AppHooks/Hooks/DeveloperOptionsScreenHook.swift | 4 ++-- .../DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift | 2 +- .../DeveloperOptionsScreenViewModel.swift | 2 +- .../DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift | 4 ++-- Enterprise | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ElementX/Sources/AppHooks/Hooks/DeveloperOptionsScreenHook.swift b/ElementX/Sources/AppHooks/Hooks/DeveloperOptionsScreenHook.swift index 470379503..626f177cd 100644 --- a/ElementX/Sources/AppHooks/Hooks/DeveloperOptionsScreenHook.swift +++ b/ElementX/Sources/AppHooks/Hooks/DeveloperOptionsScreenHook.swift @@ -8,11 +8,11 @@ import SwiftUI nonisolated protocol DeveloperOptionsScreenHookProtocol: Sendable { - func generalSectionRows() -> AnyView? + func generalSectionRows(isSignedIn: Bool) -> AnyView? } struct DefaultDeveloperOptionsScreenHook: DeveloperOptionsScreenHookProtocol { - func generalSectionRows() -> AnyView? { + func generalSectionRows(isSignedIn: Bool) -> AnyView? { nil } } diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift index 0993cd990..32414c4b0 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenModels.swift @@ -16,7 +16,7 @@ struct DeveloperOptionsScreenViewState: BindableState { let appHooks: AppHooks var storeSizes: [StoreSize]? let shouldShowClearCache: Bool - let isPresentedModally: Bool + let isSignedIn: Bool var bindings: DeveloperOptionsScreenViewStateBindings diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenViewModel.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenViewModel.swift index b97fb5a0c..187efd11a 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenViewModel.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/DeveloperOptionsScreenViewModel.swift @@ -24,7 +24,7 @@ class DeveloperOptionsScreenViewModel: DeveloperOptionsScreenViewModelType, Deve self.clientProxy = clientProxy super.init(initialViewState: .init(appHooks: appHooks, shouldShowClearCache: clientProxy != nil, - isPresentedModally: clientProxy == nil, + isSignedIn: clientProxy != nil, bindings: .init(developerOptions: developerOptions))) Task { diff --git a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift index 9627d68bb..255de1300 100644 --- a/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift +++ b/ElementX/Sources/Screens/Settings/DeveloperOptionsScreen/View/DeveloperOptionsScreen.swift @@ -60,7 +60,7 @@ struct DeveloperOptionsScreen: View { context.viewState.appHooks .developerOptionsScreenHook - .generalSectionRows() + .generalSectionRows(isSignedIn: context.viewState.isSignedIn) } Section("Room List") { @@ -214,7 +214,7 @@ struct DeveloperOptionsScreen: View { @ToolbarContentBuilder private var toolbar: some ToolbarContent { - if context.viewState.isPresentedModally { + if !context.viewState.isSignedIn { ToolbarItem(placement: .primaryAction) { if #available(iOS 26.0, *) { Button(role: .close, action: dismiss.callAsFunction) diff --git a/Enterprise b/Enterprise index ca26f2417..4bf143f56 160000 --- a/Enterprise +++ b/Enterprise @@ -1 +1 @@ -Subproject commit ca26f2417d9f2276383d606cca9814365ab366d6 +Subproject commit 4bf143f569ac2ec1b5b1b0772692fc18381a0387