diff options
author | Vitaly Takmazov | 2016-08-14 04:15:26 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-08-14 04:15:26 +0300 |
commit | c2a3fddc05e971351f919b1490869cb11e78ee30 (patch) | |
tree | c710a261646901933607157287b9383644b2daf1 /Juick/MessagesViewController.m | |
parent | 24214562b017cd45edc04c39daa343c57de16aaa (diff) |
fix thread refreshing
Diffstat (limited to 'Juick/MessagesViewController.m')
-rw-r--r-- | Juick/MessagesViewController.m | 8 |
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]; }]; |