mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Dont allow deleting system labels
This commit is contained in:
parent
98ad40fa6b
commit
0bd710e639
2 changed files with 36 additions and 32 deletions
|
|
@ -98,33 +98,35 @@
|
|||
}
|
||||
).padding(.trailing, 5)
|
||||
|
||||
Button(
|
||||
action: { performArchive() },
|
||||
label: {
|
||||
if audioController.itemAudioProperties?.isArchived ?? false {
|
||||
Image
|
||||
.toolbarUnarchive
|
||||
.foregroundColor(ThemeManager.currentTheme.toolbarColor)
|
||||
} else {
|
||||
Image
|
||||
.toolbarArchive
|
||||
.foregroundColor(ThemeManager.currentTheme.toolbarColor)
|
||||
}
|
||||
}
|
||||
).padding(.trailing, 5)
|
||||
|
||||
Menu(content: {
|
||||
if !(audioController.itemAudioProperties?.isArchived ?? false) {
|
||||
Button(
|
||||
action: { performViewArticle() },
|
||||
action: { performArchive() },
|
||||
label: {
|
||||
Text("View article")
|
||||
if audioController.itemAudioProperties?.isArchived ?? false {
|
||||
Image
|
||||
.toolbarUnarchive
|
||||
.foregroundColor(ThemeManager.currentTheme.toolbarColor)
|
||||
} else {
|
||||
Image
|
||||
.toolbarArchive
|
||||
.foregroundColor(ThemeManager.currentTheme.toolbarColor)
|
||||
}
|
||||
}
|
||||
)
|
||||
}, label: {
|
||||
Image
|
||||
.utilityMenu
|
||||
.foregroundColor(ThemeManager.currentTheme.toolbarColor)
|
||||
})
|
||||
).padding(.trailing, 5)
|
||||
}
|
||||
|
||||
// Menu(content: {
|
||||
// Button(
|
||||
// action: { performViewArticle() },
|
||||
// label: {
|
||||
// Text("View article")
|
||||
// }
|
||||
// )
|
||||
// }, label: {
|
||||
// Image
|
||||
// .utilityMenu
|
||||
// .foregroundColor(ThemeManager.currentTheme.toolbarColor)
|
||||
// })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ struct LabelsView: View {
|
|||
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
@AppStorage(UserDefaultKey.hideSystemLabels.rawValue, store: UserDefaults(suiteName: "group.app.omnivoreapp")) var hideSystemLabels = false
|
||||
@AppStorage(UserDefaultKey.hideSystemLabels.rawValue) var hideSystemLabels = false
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
|
|
@ -21,13 +21,15 @@ struct LabelsView: View {
|
|||
HStack {
|
||||
TextChip(feedItemLabel: label).allowsHitTesting(false)
|
||||
Spacer()
|
||||
Button(
|
||||
action: {
|
||||
labelToRemove = label
|
||||
showDeleteConfirmation = true
|
||||
},
|
||||
label: { Image(systemName: "trash") }
|
||||
)
|
||||
if !isSystemLabel(label) {
|
||||
Button(
|
||||
action: {
|
||||
labelToRemove = label
|
||||
showDeleteConfirmation = true
|
||||
},
|
||||
label: { Image(systemName: "trash") }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
createLabelButton
|
||||
|
|
|
|||
Loading…
Reference in a new issue