From c2a3fddc05e971351f919b1490869cb11e78ee30 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 14 Aug 2016 04:15:26 +0300 Subject: fix thread refreshing --- Juick/MessagesViewController.m | 8 ++++++-- 1 file 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]; }]; -- cgit v1.2.3