Fix a rare crash when invoking "Mark previous as read" action

Closes mihonapp/mihon#1421

(cherry picked from commit f508d10ad13560d7316df8642bc93fe66c05b9a8)
This commit is contained in:
AntsyLich 2024-10-31 19:08:11 +06:00 committed by Cuong-Tran
parent 3490273afe
commit d13abbd223
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2
2 changed files with 2 additions and 0 deletions

View file

@ -13,6 +13,7 @@ The format is a modified version of [Keep a Changelog](https://keepachangelog.co
## [Unreleased]
### Fixed
- Fixed "currentTab was used multiple times"
- Fixed a rare crash when invoking "Mark previous as read" action
### Improved
- Bangumi search now shows the score and summary of a search result ([@MajorTanya](https://github.com/MajorTanya)) ([#1396](https://github.com/mihonapp/mihon/pull/1396))

View file

@ -1334,6 +1334,7 @@ class MangaScreenModel(
*/
fun markChaptersRead(chapters: List<Chapter>, read: Boolean) {
toggleAllSelection(false)
if (chapters.isEmpty()) return
screenModelScope.launchIO {
setReadStatus.await(
read = read,