Reorder modifiers to fix context menus on macOS 14 (#774)

This commit is contained in:
Max Goedjen 2025-12-13 20:29:06 -08:00 committed by GitHub
parent 595de41f03
commit 845b1ec313
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,6 +24,18 @@ struct SecretListItemView: View {
Text(secret.name) Text(secret.name)
} }
} }
.sheet(isPresented: $isRenaming, onDismiss: {
renamedSecret(secret)
}, content: {
if let modifiable = store as? AnySecretStoreModifiable {
EditSecretView(store: modifiable, secret: secret)
}
})
.showingDeleteConfirmation(isPresented: $isDeleting, secret, store as? AnySecretStoreModifiable) { deleted in
if deleted {
deletedSecret(secret)
}
}
.contextMenu { .contextMenu {
if store is AnySecretStoreModifiable { if store is AnySecretStoreModifiable {
Button(action: { isRenaming = true }) { Button(action: { isRenaming = true }) {
@ -36,17 +48,5 @@ struct SecretListItemView: View {
} }
} }
} }
.showingDeleteConfirmation(isPresented: $isDeleting, secret, store as? AnySecretStoreModifiable) { deleted in
if deleted {
deletedSecret(secret)
}
}
.sheet(isPresented: $isRenaming, onDismiss: {
renamedSecret(secret)
}, content: {
if let modifiable = store as? AnySecretStoreModifiable {
EditSecretView(store: modifiable, secret: secret)
}
})
} }
} }