Skip to content

Commit

Permalink
Fix ‘B’ key to always go to first unread article
Browse files Browse the repository at this point in the history
  • Loading branch information
barijaona committed Aug 14, 2016
1 parent c88ee6b commit 1bd1831
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/ArticleController.m
Expand Up @@ -350,8 +350,12 @@ -(void)sortArticles
*/
-(void)displayFirstUnread
{
// remember current article
// mark current article read
Article * currentArticle = self.selectedArticle;
if (currentArticle != nil && !currentArticle.read)
{
[self markReadByArray:@[currentArticle] readFlag:YES];
}

// If there are any unread articles then select the first one in the
// first folder.
Expand All @@ -361,7 +365,7 @@ -(void)displayFirstUnread
NSInteger firstFolderWithUnread = foldersTree.firstFolderWithUnread;
if (firstFolderWithUnread == currentFolderId)
{
[self displayNextUnread];
[mainArticleView selectFirstUnreadInFolder];
}
else
{
Expand All @@ -371,13 +375,6 @@ -(void)displayFirstUnread
[foldersTree selectFolder:firstFolderWithUnread];
}
}

// mark read previously selected article
if (currentArticle != nil && !currentArticle.read)
{
[self markReadByArray:@[currentArticle] readFlag:YES];
}

}

/* displayNextUnread
Expand Down

0 comments on commit 1bd1831

Please sign in to comment.