mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-18 22:02:11 +00:00
macOS: Fix empty space in "Delete profile"
Show nothing when profile is new.
This commit is contained in:
parent
5b6a689afa
commit
36d9ac59b8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user