mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-06 12:28:29 +00:00
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:
@@ -8,11 +8,11 @@
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
nonisolated protocol DeveloperOptionsScreenHookProtocol: Sendable {
|
nonisolated protocol DeveloperOptionsScreenHookProtocol: Sendable {
|
||||||
func generalSectionRows() -> AnyView?
|
func generalSectionRows(isSignedIn: Bool) -> AnyView?
|
||||||
}
|
}
|
||||||
|
|
||||||
struct DefaultDeveloperOptionsScreenHook: DeveloperOptionsScreenHookProtocol {
|
struct DefaultDeveloperOptionsScreenHook: DeveloperOptionsScreenHookProtocol {
|
||||||
func generalSectionRows() -> AnyView? {
|
func generalSectionRows(isSignedIn: Bool) -> AnyView? {
|
||||||
nil
|
nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ struct DeveloperOptionsScreenViewState: BindableState {
|
|||||||
let appHooks: AppHooks
|
let appHooks: AppHooks
|
||||||
var storeSizes: [StoreSize]?
|
var storeSizes: [StoreSize]?
|
||||||
let shouldShowClearCache: Bool
|
let shouldShowClearCache: Bool
|
||||||
let isPresentedModally: Bool
|
let isSignedIn: Bool
|
||||||
|
|
||||||
var bindings: DeveloperOptionsScreenViewStateBindings
|
var bindings: DeveloperOptionsScreenViewStateBindings
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ class DeveloperOptionsScreenViewModel: DeveloperOptionsScreenViewModelType, Deve
|
|||||||
self.clientProxy = clientProxy
|
self.clientProxy = clientProxy
|
||||||
super.init(initialViewState: .init(appHooks: appHooks,
|
super.init(initialViewState: .init(appHooks: appHooks,
|
||||||
shouldShowClearCache: clientProxy != nil,
|
shouldShowClearCache: clientProxy != nil,
|
||||||
isPresentedModally: clientProxy == nil,
|
isSignedIn: clientProxy != nil,
|
||||||
bindings: .init(developerOptions: developerOptions)))
|
bindings: .init(developerOptions: developerOptions)))
|
||||||
|
|
||||||
Task {
|
Task {
|
||||||
|
|||||||
+2
-2
@@ -60,7 +60,7 @@ struct DeveloperOptionsScreen: View {
|
|||||||
|
|
||||||
context.viewState.appHooks
|
context.viewState.appHooks
|
||||||
.developerOptionsScreenHook
|
.developerOptionsScreenHook
|
||||||
.generalSectionRows()
|
.generalSectionRows(isSignedIn: context.viewState.isSignedIn)
|
||||||
}
|
}
|
||||||
|
|
||||||
Section("Room List") {
|
Section("Room List") {
|
||||||
@@ -214,7 +214,7 @@ struct DeveloperOptionsScreen: View {
|
|||||||
|
|
||||||
@ToolbarContentBuilder
|
@ToolbarContentBuilder
|
||||||
private var toolbar: some ToolbarContent {
|
private var toolbar: some ToolbarContent {
|
||||||
if context.viewState.isPresentedModally {
|
if !context.viewState.isSignedIn {
|
||||||
ToolbarItem(placement: .primaryAction) {
|
ToolbarItem(placement: .primaryAction) {
|
||||||
if #available(iOS 26.0, *) {
|
if #available(iOS 26.0, *) {
|
||||||
Button(role: .close, action: dismiss.callAsFunction)
|
Button(role: .close, action: dismiss.callAsFunction)
|
||||||
|
|||||||
+1
-1
Submodule Enterprise updated: ca26f2417d...4bf143f569
Reference in New Issue
Block a user