Hide page controls in libraries where unnecessary

This commit is contained in:
Aiden Vigue 2021-05-25 14:11:10 -04:00
parent efeb1c142e
commit b18e2e3ae4
No known key found for this signature in database
GPG Key ID: E7570472648F4544
1 changed files with 13 additions and 11 deletions

View File

@ -285,18 +285,20 @@ struct LibraryView: View {
.navigationTitle(extraParam == "" ? (library_names[prefill_id] ?? "Library") : title)
.toolbar {
ToolbarItemGroup(placement: .navigationBarTrailing) {
if(firstItemIndex != 0) {
Button {
previousPage()
} label: {
Image(systemName: "chevron.left")
if(totalItemCount > itemsPerPage) {
if(firstItemIndex != 0) {
Button {
previousPage()
} label: {
Image(systemName: "chevron.left")
}
}
}
if(lastItemIndex != totalItemCount) {
Button {
nextPage()
} label: {
Image(systemName: "chevron.right")
if(lastItemIndex != totalItemCount) {
Button {
nextPage()
} label: {
Image(systemName: "chevron.right")
}
}
}
NavigationLink(destination: LibrarySearchView(url: url, close: $closeSearch), isActive: $closeSearch) {