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) .frame(maxWidth: .infinity, alignment: .center)
} }
#else #else
UUIDText(uuid: profileId) if isExistingProfile {
.asSectionWithTrailingContent { uuidView
removeContent .asSectionWithTrailingContent(removeContent)
} } else {
uuidView
}
#endif #endif
} }
} }
private extension ProfileActionsSection { 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) profileManager.profile(withId: profileId)
.map { _ in .map { _ in
removeButton removeButton