Skip to content

Commit

Permalink
[Archive] Fix deleted category
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyfreeman committed Feb 11, 2024
1 parent 892c8a2 commit 81094cd
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ struct CategoryDeletedView: View {
}

var toolbarActionsColor: Color {
archive.items.isEmpty ? .primary.opacity(0.5) : .primary
archive.deleted.isEmpty ? .primary.opacity(0.5) : .primary
}

var body: some View {
ZStack {
Text("No deleted keys")
.font(.system(size: 16, weight: .medium))
.foregroundColor(.black40)
.opacity(archive.items.isEmpty ? 1 : 0)
.opacity(archive.deleted.isEmpty ? 1 : 0)

ScrollView {
CategoryList(items: archive.deleted) { item in
Expand All @@ -54,7 +54,7 @@ struct CategoryDeletedView: View {
}
}
PrincipalToolbarItems(alignment: .leading) {
Title("Delete")
Title("Deleted")
}
TrailingToolbarItems {
HStack(spacing: 8) {
Expand All @@ -65,7 +65,6 @@ struct CategoryDeletedView: View {
.font(.system(size: 12, weight: .bold))
.foregroundColor(toolbarActionsColor)
}
.disabled(archive.items.isEmpty)
.confirmationDialog(
restoreSheetTitle,
isPresented: $showRestoreSheet,
Expand All @@ -83,7 +82,6 @@ struct CategoryDeletedView: View {
.font(.system(size: 12, weight: .bold))
.foregroundColor(toolbarActionsColor)
}
.disabled(archive.items.isEmpty)
.confirmationDialog(
deleteSheetTitle,
isPresented: $showDeleteSheet,
Expand All @@ -94,6 +92,7 @@ struct CategoryDeletedView: View {
}
}
}
.disabled(archive.deleted.isEmpty)
}
}
}
Expand Down

0 comments on commit 81094cd

Please sign in to comment.