summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-08-14 04:15:26 +0300
committerGravatar Vitaly Takmazov2016-08-14 04:15:26 +0300
commitc2a3fddc05e971351f919b1490869cb11e78ee30 (patch)
treec710a261646901933607157287b9383644b2daf1
parent24214562b017cd45edc04c39daa343c57de16aaa (diff)
fix thread refreshing
-rw-r--r--Juick/MessagesViewController.m8
1 files changed, 6 insertions, 2 deletions
diff --git a/Juick/MessagesViewController.m b/Juick/MessagesViewController.m
index 25622a9..24b8185 100644
--- a/Juick/MessagesViewController.m
+++ b/Juick/MessagesViewController.m
@@ -83,8 +83,12 @@ static NSString *CellIdentifier = @"MessageCell";
[self.refreshControl addTarget:self action:@selector(refreshData) forControlEvents:UIControlEventValueChanged];
__weak MessagesViewController * weakSelf = self;
[self.tableView addInfiniteScrollWithHandler:^(UITableView * _Nonnull tableView) {
- NSNumber *lastMid = ((Message *)[weakSelf.messages lastObject]).MID;
- [weakSelf.params setValue:lastMid forKey:@"before_mid"];
+ if ([weakSelf.path isEqualToString:[Message threadUrl]]) {
+ [weakSelf.messages removeAllObjects];
+ } else {
+ NSNumber *lastMid = ((Message *)[weakSelf.messages lastObject]).MID;
+ [weakSelf.params setValue:lastMid forKey:@"before_mid"];
+ }
[weakSelf refreshData];
[weakSelf.tableView finishInfiniteScroll];
}];