ios: more sheets will become hidden while protect screen on (#4259)

Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
This commit is contained in:
Stanislav Dmitrenko
2024-06-01 04:47:57 +07:00
committed by GitHub
parent 3c98c6acc0
commit c52e5349db
4 changed files with 11 additions and 9 deletions

View File

@@ -24,7 +24,7 @@ struct CIInvalidJSONView: View {
.cornerRadius(18)
.textSelection(.disabled)
.onTapGesture { showJSON = true }
.sheet(isPresented: $showJSON) {
.appSheet(isPresented: $showJSON) {
invalidJSONView(json)
}
}

View File

@@ -131,7 +131,7 @@ struct ChatView: View {
} label: {
ChatInfoToolbar(chat: chat)
}
.sheet(isPresented: $showChatInfoSheet, onDismiss: {
.appSheet(isPresented: $showChatInfoSheet, onDismiss: {
connectionStats = nil
customUserProfile = nil
connectionCode = nil

View File

@@ -349,10 +349,12 @@ struct ChatListNavLink: View {
.tint(.accentColor)
}
.frame(height: rowHeights[dynamicTypeSize])
.sheet(isPresented: $showContactConnectionInfo) {
if case let .contactConnection(contactConnection) = chat.chatInfo {
ContactConnectionInfo(contactConnection: contactConnection)
.environment(\EnvironmentValues.refresh as! WritableKeyPath<EnvironmentValues, RefreshAction?>, nil)
.appSheet(isPresented: $showContactConnectionInfo) {
Group {
if case let .contactConnection(contactConnection) = chat.chatInfo {
ContactConnectionInfo(contactConnection: contactConnection)
.environment(\EnvironmentValues.refresh as! WritableKeyPath<EnvironmentValues, RefreshAction?>, nil)
}
}
}
.onTapGesture {
@@ -467,7 +469,7 @@ struct ChatListNavLink: View {
.padding(4)
.frame(height: rowHeights[dynamicTypeSize])
.onTapGesture { showInvalidJSON = true }
.sheet(isPresented: $showInvalidJSON) {
.appSheet(isPresented: $showInvalidJSON) {
invalidJSONView(json)
.environment(\EnvironmentValues.refresh as! WritableKeyPath<EnvironmentValues, RefreshAction?>, nil)
}

View File

@@ -123,7 +123,7 @@ struct UserProfilesView: View {
deleteModeButton("Profile and server connections", true)
deleteModeButton("Local profile data only", false)
}
.sheet(item: $selectedUser) { user in
.appSheet(item: $selectedUser) { user in
HiddenProfileView(user: user, profileHidden: $profileHidden)
}
.onChange(of: profileHidden) { _ in
@@ -131,7 +131,7 @@ struct UserProfilesView: View {
withAnimation { profileHidden = false }
}
}
.sheet(item: $profileAction) { action in
.appSheet(item: $profileAction) { action in
profileActionView(action)
}
.alert(item: $alert) { alert in