mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-20 23:02:14 +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)
|
.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
|
||||||
|
Loading…
Reference in New Issue
Block a user