commit dfb681cc02b6ab8320b7da1e0efdcea257b2411c
parent 889c5844873c0627f965c36dec08fdfe2fc17806
Author: William Casarin <jb55@jb55.com>
Date: Mon, 30 Jan 2023 16:39:52 -0800
Fix profile action sheet on ipad
Changelog-Fixed: Fix hidden profile action sheet when clicking ...
Diffstat:
2 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/damus/Views/ConfigView.swift b/damus/Views/ConfigView.swift
@@ -130,9 +130,9 @@ struct ConfigView: View {
if state.is_privkey_user {
Section(NSLocalizedString("Delete", comment: "Section title for deleting the user")) {
- Button(NSLocalizedString("Delete Account", comment: "Button to delete the user's account."), role: .destructive) {
- confirm_delete_account = true
- }
+ Button(NSLocalizedString("Delete Account", comment: "Button to delete the user's account."), role: .destructive) {
+ confirm_delete_account = true
+ }
}
}
}
diff --git a/damus/Views/ProfileView.swift b/damus/Views/ProfileView.swift
@@ -175,6 +175,24 @@ struct ProfileView: View {
Image(systemName: "ellipsis.circle")
.profile_button_style(scheme: colorScheme)
}
+ .confirmationDialog(NSLocalizedString("Actions", comment: "Title for confirmation dialog to either share, report, or block a profile."), isPresented: $action_sheet_presented) {
+ Button(NSLocalizedString("Share", comment: "Button to share the link to a profile.")) {
+ show_share_sheet = true
+ }
+
+ // Only allow reporting if logged in with private key and the currently viewed profile is not the logged in profile.
+ if profile.pubkey != damus_state.pubkey && damus_state.is_privkey_user {
+ Button(NSLocalizedString("Report", comment: "Button to report a profile."), role: .destructive) {
+ let target: ReportTarget = .user(profile.pubkey)
+ notify(.report, target)
+ }
+
+ Button(NSLocalizedString("Block", comment: "Button to block a profile."), role: .destructive) {
+ notify(.block, profile.pubkey)
+ }
+ }
+ }
+
}
var ShareButton: some View {
@@ -375,23 +393,6 @@ struct ProfileView: View {
}
}
}
- .confirmationDialog(NSLocalizedString("Actions", comment: "Title for confirmation dialog to either share, report, or block a profile."), isPresented: $action_sheet_presented) {
- Button(NSLocalizedString("Share", comment: "Button to share the link to a profile.")) {
- show_share_sheet = true
- }
-
- // Only allow reporting if logged in with private key and the currently viewed profile is not the logged in profile.
- if profile.pubkey != damus_state.pubkey && damus_state.is_privkey_user {
- Button(NSLocalizedString("Report", comment: "Button to report a profile."), role: .destructive) {
- let target: ReportTarget = .user(profile.pubkey)
- notify(.report, target)
- }
-
- Button(NSLocalizedString("Block", comment: "Button to block a profile."), role: .destructive) {
- notify(.block, profile.pubkey)
- }
- }
- }
.ignoresSafeArea()
}
}