mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-11 05:45:56 +10:00
Merge branch 'develop' of https://github.com/CatchChat/Yep into develop
This commit is contained in:
@@ -2517,7 +2517,7 @@ let parseFeeds: JSONDictionary -> [DiscoveredFeed]? = { data in
|
||||
return []
|
||||
}
|
||||
|
||||
func discoverFeedsWithSortStyle(sortStyle: FeedSortStyle, skill: Skill?, pageIndex: Int, perPage: Int, failureHandler: ((Reason, String?) -> Void)?,completion: [DiscoveredFeed] -> Void) {
|
||||
func discoverFeedsWithSortStyle(sortStyle: FeedSortStyle, skill: Skill?, pageIndex: Int, perPage: Int, maxFeedID: String?, failureHandler: ((Reason, String?) -> Void)?,completion: [DiscoveredFeed] -> Void) {
|
||||
|
||||
var requestParameters: JSONDictionary = [
|
||||
"sort": sortStyle.rawValue,
|
||||
@@ -2529,6 +2529,10 @@ func discoverFeedsWithSortStyle(sortStyle: FeedSortStyle, skill: Skill?, pageInd
|
||||
requestParameters["skill_id"] = skill.id
|
||||
}
|
||||
|
||||
if let maxFeedID = maxFeedID {
|
||||
requestParameters["max_id"] = maxFeedID
|
||||
}
|
||||
|
||||
let parse = parseFeeds
|
||||
|
||||
let resource = authJsonResource(path: "/api/v1/topics/discover", method: .GET, requestParameters: requestParameters, parse: parse)
|
||||
|
||||
@@ -238,7 +238,9 @@ class FeedsViewController: UIViewController {
|
||||
currentPageIndex = 1
|
||||
}
|
||||
|
||||
discoverFeedsWithSortStyle(feedSortStyle, skill: skill, pageIndex: currentPageIndex, perPage: 25, failureHandler: { reason, errorMessage in
|
||||
let maxFeedID = (feedSortStyle == FeedSortStyle.Time) ? feeds.last?.id : nil
|
||||
|
||||
discoverFeedsWithSortStyle(feedSortStyle, skill: skill, pageIndex: currentPageIndex, perPage: 25, maxFeedID: maxFeedID, failureHandler: { reason, errorMessage in
|
||||
|
||||
dispatch_async(dispatch_get_main_queue()) { [weak self] in
|
||||
|
||||
|
||||
Reference in New Issue
Block a user