Add signed in flag to the developer options screen hook (#5914)

add signed in flag to the developer options screen hook
This commit is contained in:
Mauro
2026-07-22 11:40:27 +02:00
committed by GitHub
parent b5b28b9986
commit 4f03acab0c
5 changed files with 7 additions and 7 deletions
@@ -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
}
}
@@ -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
@@ -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 {
@@ -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)