From c52e5349db3139dd88f0e291d95f91422ab88cd2 Mon Sep 17 00:00:00 2001 From: Stanislav Dmitrenko <7953703+avently@users.noreply.github.com> Date: Sat, 1 Jun 2024 04:47:57 +0700 Subject: [PATCH] ios: more sheets will become hidden while protect screen on (#4259) Co-authored-by: Evgeny Poberezkin --- .../Views/Chat/ChatItem/CIInvalidJSONView.swift | 2 +- apps/ios/Shared/Views/Chat/ChatView.swift | 2 +- apps/ios/Shared/Views/ChatList/ChatListNavLink.swift | 12 +++++++----- .../Shared/Views/UserSettings/UserProfilesView.swift | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/ios/Shared/Views/Chat/ChatItem/CIInvalidJSONView.swift b/apps/ios/Shared/Views/Chat/ChatItem/CIInvalidJSONView.swift index 0299a5e6f8..40ed8bc76c 100644 --- a/apps/ios/Shared/Views/Chat/ChatItem/CIInvalidJSONView.swift +++ b/apps/ios/Shared/Views/Chat/ChatItem/CIInvalidJSONView.swift @@ -24,7 +24,7 @@ struct CIInvalidJSONView: View { .cornerRadius(18) .textSelection(.disabled) .onTapGesture { showJSON = true } - .sheet(isPresented: $showJSON) { + .appSheet(isPresented: $showJSON) { invalidJSONView(json) } } diff --git a/apps/ios/Shared/Views/Chat/ChatView.swift b/apps/ios/Shared/Views/Chat/ChatView.swift index 4055ca2b28..27eb3bd653 100644 --- a/apps/ios/Shared/Views/Chat/ChatView.swift +++ b/apps/ios/Shared/Views/Chat/ChatView.swift @@ -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 diff --git a/apps/ios/Shared/Views/ChatList/ChatListNavLink.swift b/apps/ios/Shared/Views/ChatList/ChatListNavLink.swift index efe254323e..73c3c73556 100644 --- a/apps/ios/Shared/Views/ChatList/ChatListNavLink.swift +++ b/apps/ios/Shared/Views/ChatList/ChatListNavLink.swift @@ -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, nil) + .appSheet(isPresented: $showContactConnectionInfo) { + Group { + if case let .contactConnection(contactConnection) = chat.chatInfo { + ContactConnectionInfo(contactConnection: contactConnection) + .environment(\EnvironmentValues.refresh as! WritableKeyPath, 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, nil) } diff --git a/apps/ios/Shared/Views/UserSettings/UserProfilesView.swift b/apps/ios/Shared/Views/UserSettings/UserProfilesView.swift index 8c1a3bf4e1..5da7c8e877 100644 --- a/apps/ios/Shared/Views/UserSettings/UserProfilesView.swift +++ b/apps/ios/Shared/Views/UserSettings/UserProfilesView.swift @@ -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