Allow deletion of TV profiles

Fixes #480
This commit is contained in:
Davide De Rosa 2024-09-22 15:41:53 +02:00
parent f4184bd459
commit 5587b9902a
No known key found for this signature in database
GPG Key ID: A48836171C759F5E
1 changed files with 14 additions and 0 deletions

View File

@ -42,6 +42,7 @@ struct OrganizerView: View {
List {
ActiveProfileView(profileManager: profileManager)
aboutSection
deleteSection
}
.navigationTitle(Unlocalized.appName)
.themeTV()
@ -63,6 +64,19 @@ private extension OrganizerView {
Text(L10n.About.title)
}
}
var deleteSection: some View {
Section {
Button(L10n.Global.Strings.delete, role: .destructive) {
profileManager.activeProfileId.map { profileId in
withAnimation {
profileManager.removeProfiles(withIds: [profileId])
}
}
}
.disabled(!profileManager.hasActiveProfile)
}
}
}
// MARK: Mock