macOS: Fix empty space in "Delete profile"

Show nothing when profile is new.
This commit is contained in:
Davide 2025-02-11 10:44:25 +01:00
parent 5b6a689afa
commit 36d9ac59b8
No known key found for this signature in database
GPG Key ID: A48836171C759F5E

View File

@ -49,16 +49,26 @@ struct ProfileActionsSection: View {
.frame(maxWidth: .infinity, alignment: .center)
}
#else
UUIDText(uuid: profileId)
.asSectionWithTrailingContent {
removeContent
}
if isExistingProfile {
uuidView
.asSectionWithTrailingContent(removeContent)
} else {
uuidView
}
#endif
}
}
private extension ProfileActionsSection {
var removeContent: some View {
var isExistingProfile: Bool {
profileManager.profile(withId: profileId) != nil
}
var uuidView: some View {
UUIDText(uuid: profileId)
}
func removeContent() -> some View {
profileManager.profile(withId: profileId)
.map { _ in
removeButton