mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Consider sort direction when resuming (fixes #4909)
This commit is contained in:
		@@ -474,7 +474,12 @@ class MangaPresenter(
 | 
			
		||||
     * Returns the next unread chapter or null if everything is read.
 | 
			
		||||
     */
 | 
			
		||||
    fun getNextUnreadChapter(): ChapterItem? {
 | 
			
		||||
        return chapters.sortedWith(getChapterSort()).findLast { !it.read }
 | 
			
		||||
        val chapters = chapters.sortedWith(getChapterSort())
 | 
			
		||||
        return if (sortDescending()) {
 | 
			
		||||
            return chapters.findLast { !it.read }
 | 
			
		||||
        } else {
 | 
			
		||||
            chapters.find { !it.read }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user