Skip to content

Commit

Permalink
Fix Pager with no pages
Browse files Browse the repository at this point in the history
  • Loading branch information
fermoya committed Jul 20, 2022
1 parent d8d3107 commit 6f9c413
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/SwiftUIPager/Page.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class Page: ObservableObject {
var totalPages: Int = Int.max {
didSet {
// reset in case there's a deletion
self.index = index
self.index = totalPages > 0 ? index : 0
}
}

Expand Down

0 comments on commit 6f9c413

Please sign in to comment.