dont show delete option if the item is missing
This commit is contained in:
@@ -63,18 +63,18 @@ struct ContentView: View {
|
||||
}).alert(String(localized: "content_view_fill_in_missing_entry"), isPresented: $showUpdateEntryAlert) {
|
||||
ForEach(Mood.allValues) { mood in
|
||||
Button(mood.strValue, action: {
|
||||
if let selectedMissingEntry = selectedEntry {
|
||||
viewModel.update(entry: selectedMissingEntry, toMood: mood)
|
||||
if let selectedEntry = selectedEntry {
|
||||
viewModel.update(entry: selectedEntry, toMood: mood)
|
||||
}
|
||||
showUpdateEntryAlert = false
|
||||
})
|
||||
}
|
||||
|
||||
if deleteEnabled {
|
||||
if let selectedEntry = selectedEntry,
|
||||
deleteEnabled,
|
||||
selectedEntry.mood != .missing {
|
||||
Button(String(localized: "content_view_delete_entry"), action: {
|
||||
if let selectedMissingEntry = selectedEntry {
|
||||
viewModel.update(entry: selectedMissingEntry, toMood: Mood.missing)
|
||||
}
|
||||
viewModel.update(entry: selectedEntry, toMood: Mood.missing)
|
||||
showUpdateEntryAlert = false
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user