Skip to content

Commit

Permalink
Merge pull request #56 from tatsuz0u/develop
Browse files Browse the repository at this point in the history
fix: Pagination issue
  • Loading branch information
tatsuz0u authored Sep 11, 2021
2 parents cad856e + e8cda0b commit c0da678
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
types: [closed]
env:
DEVELOPER_DIR: /Applications/Xcode_13.0.app
APP_VERSION: '1.1.0'
APP_VERSION: '1.1.1'
SCHEME_NAME: 'EhPanda'
BUILDS_PATH: '/tmp/action-builds'
ARCHIVE_PATH: '/tmp/action-builds/EhPanda.xcarchive'
Expand Down
2 changes: 1 addition & 1 deletion EhPanda/App/Tools/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ extension Parser {
}
for aLink in link.xpath("//a") {
if let num = Int(aLink.text ?? "") {
maximum = num
maximum = num - 1
}
}
return PageNumber(current: current, maximum: maximum)
Expand Down
2 changes: 1 addition & 1 deletion EhPanda/Models/Misc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typealias ReloadToken = Any

struct PageNumber {
var current = 0
var maximum = 1
var maximum = 0
}

struct Greeting: Codable, Equatable {
Expand Down
9 changes: 4 additions & 5 deletions EhPanda/View/Detail/AssociatedView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private extension AssociatedView {
SwiftyBeaver.info(
"SearchItemsRequest succeeded",
context: [
"Keyword": keyword.isEmpty ? title : keyword,
"Keyword": keyword.isEmpty ? title : keyword, "PageNumber": pageNumber,
"Galleries count": galleries.count
]
)
Expand All @@ -130,7 +130,7 @@ private extension AssociatedView {
"SearchItemsRequest failed",
context: [
"Keyword": keyword.isEmpty ? title : keyword,
"Error": loadError as Any
"PageNumber": pageNumber, "Error": loadError as Any
]
)
}
Expand Down Expand Up @@ -169,7 +169,7 @@ private extension AssociatedView {
"MoreSearchItemsRequest failed",
context: [
"Keyword": keyword, "LastID": lastID,
"PageNum": pageNumber.current + 1, "Error": error
"PageNumber": pageNumber, "Error": error
]
)
}
Expand All @@ -191,8 +191,7 @@ private extension AssociatedView {
SwiftyBeaver.info(
"MoreSearchItemsRequest succeeded",
context: [
"Keyword": keyword, "LastID": lastID,
"PageNum": pageNumber.current + 1,
"Keyword": keyword, "LastID": lastID, "PageNumber": pageNumber,
"Galleries count": galleries.count
]
)
Expand Down

0 comments on commit c0da678

Please sign in to comment.