Skip to content

Commit

Permalink
fix following view duplicate problem
Browse files Browse the repository at this point in the history
  • Loading branch information
黄伟锋 committed Sep 15, 2015
1 parent 5d1f062 commit 7ffefff
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions LIKE/LIKE/LKApplication/Application/Home/LKHomeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -787,14 +787,12 @@ -(void) loadData:(LCUIPullLoaderDiretion)diretion
if (self.feedType == LKHomepageFeedTypeFocus) {

if (self.focusNext && diretion == LCUIPullLoaderDiretionBottom) {

[interface addParameter:self.focusNext key:@"ts"];
}
}
else{

if (/*!LC_NSSTRING_IS_INVALID*/(self.next) && diretion == LCUIPullLoaderDiretionBottom) {

if ((self.next) && diretion == LCUIPullLoaderDiretionBottom) {
[interface addParameter:self.next key:@"ts"];
}
}
Expand All @@ -807,13 +805,13 @@ -(void) loadData:(LCUIPullLoaderDiretion)diretion

if (result.state == LKHttpRequestStateFinished) {

if (self.feedType == LKHomepageFeedTypeFocus) {
self.focusNext = result.json[@"data"][@"next"] ? result.json[@"data"][@"next"] : nil;
}
else{

self.next = result.json[@"data"][@"next"] ? result.json[@"data"][@"next"] : nil/*@""*/;
NSNumber *resultNext = result.json[@"data"][@"next"];
if (resultNext) {
if (self.feedType == LKHomepageFeedTypeFocus) {
self.focusNext = resultNext;
} else {
self.next = resultNext;
}
}

NSArray * resultData = result.json[@"data"][@"posts"];
Expand All @@ -825,7 +823,7 @@ -(void) loadData:(LCUIPullLoaderDiretion)diretion
}

if (diretion == LCUIPullLoaderDiretionTop) {


// Change datasource and save cache...
if (self.feedType == LKHomepageFeedTypeFocus) {
Expand Down

0 comments on commit 7ffefff

Please sign in to comment.