summaryrefslogtreecommitdiff
path: root/Juick
diff options
context:
space:
mode:
Diffstat (limited to 'Juick')
-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];
}];