Skip to content

Commit

Permalink
hide clear jobs button if there are no jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
tobitech committed Jul 10, 2024
1 parent c1e9b54 commit d9d646b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Example/SmileID/Jobs/JobsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ struct JobsView: View {
.navigationTitle("Jobs")
.toolbar {
ToolbarItem {
Button(action: {
viewModel.clearButtonTapped()
}, label: {
Image(systemName: "trash.fill")
})
.buttonStyle(.plain)
if !viewModel.jobs.isEmpty {
Button(action: {
viewModel.clearButtonTapped()
}, label: {
Image(systemName: "trash.fill")
})
.buttonStyle(.plain)
}
}
}
.onAppear {
Expand Down

0 comments on commit d9d646b

Please sign in to comment.