From d856b364dea82f7b89e2040075ee32d988707edb Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 7 Dec 2017 00:18:52 +0300 Subject: refactor --- Juick/ViewControllers/MessagesViewController.m | 4 ++-- Juick/ViewControllers/ThreadViewController.m | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'Juick/ViewControllers') diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m index 71f4271..80e8c73 100644 --- a/Juick/ViewControllers/MessagesViewController.m +++ b/Juick/ViewControllers/MessagesViewController.m @@ -29,8 +29,8 @@ NSArray *newMsgs = next; NSUInteger oldCount = [self.messages count]; if ([self.path isEqualToString:[APIClient threadUrl]]) { - NSUInteger lastRid = [((Message *)[self.messages lastObject]).rid unsignedIntegerValue]; - NSUInteger count = [next count] - 1; + NSUInteger lastRid = [((Message *)[self.messages lastObject]).rid unsignedIntegerValue] + 1; + NSUInteger count = [next count]; if (oldCount > 0) { if (lastRid && lastRid < count) { newMsgs = [next subarrayWithRange:NSMakeRange(lastRid, count - lastRid)]; diff --git a/Juick/ViewControllers/ThreadViewController.m b/Juick/ViewControllers/ThreadViewController.m index 95c9839..06cbf9a 100644 --- a/Juick/ViewControllers/ThreadViewController.m +++ b/Juick/ViewControllers/ThreadViewController.m @@ -61,6 +61,7 @@ [[APIClient sharedClient] postReplyToThread:msg.mid inReplyTo:self.replyTo text:inputView.textContent.text result:^(Message *msg, NSError *err) { MessageInputView *inputView = (MessageInputView *)self.inputAccessoryView; inputView.quoteText.text = @""; + inputView.textContent.text = @""; [inputView.textContent endEditing:YES]; [self refreshData]; }]; -- cgit v1.2.3