mirror of
https://github.com/jellyfin/Swiftfin.git
synced 2024-12-14 01:18:44 +00:00
Add page descriphion
This commit is contained in:
parent
04936e75af
commit
82c0474662
@ -73,7 +73,7 @@ struct LibraryView: View {
|
||||
} label: {
|
||||
Image(systemName: "chevron.left").font(.system(size: 25))
|
||||
}.disabled(viewModel.isHiddenPreviousButton)
|
||||
Spacer()
|
||||
Text("\(viewModel.page) of \(viewModel.totalPages)")
|
||||
Button {
|
||||
viewModel.requestNextPage()
|
||||
} label: {
|
||||
|
@ -28,7 +28,11 @@ final class LibraryViewModel: ObservableObject {
|
||||
var isHiddenPreviousButton = true
|
||||
@Published
|
||||
var isHiddenNextButton = true
|
||||
|
||||
@Published
|
||||
var totalPages = 1
|
||||
|
||||
@Published
|
||||
var page = 1
|
||||
|
||||
var globalData = GlobalData() {
|
||||
@ -125,6 +129,8 @@ final class LibraryViewModel: ObservableObject {
|
||||
print(items.count)
|
||||
print(self.page)
|
||||
|
||||
self.totalPages = Int(Float(Double(count)/100.0).rounded(.up))
|
||||
|
||||
if(count > 100) {
|
||||
self.isHiddenPreviousButton = true
|
||||
self.isHiddenNextButton = true
|
||||
|
Loading…
Reference in New Issue
Block a user