mirror of
https://github.com/mihonapp/mihon.git
synced 2025-08-19 21:11:31 +02:00
Compare commits
2 Commits
63a3acf381
...
90f93ca9f9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90f93ca9f9 | ||
|
|
c74f62f20e |
@@ -716,6 +716,7 @@ class MangaScreenModel(
|
||||
* @param read whether to mark chapters as read or unread.
|
||||
*/
|
||||
fun markChaptersRead(chapters: List<Chapter>, read: Boolean) {
|
||||
toggleAllSelection(false)
|
||||
screenModelScope.launchIO {
|
||||
setReadStatus.await(
|
||||
read = read,
|
||||
@@ -723,16 +724,15 @@ class MangaScreenModel(
|
||||
)
|
||||
|
||||
if (!read) return@launchIO
|
||||
|
||||
val tracks = getTracks.await(mangaId)
|
||||
val maxChapterNumber = chapters.maxOf { it.chapterNumber }
|
||||
val shouldPromptTrackingUpdate = tracks.any { track ->
|
||||
maxChapterNumber > track.lastChapterRead
|
||||
}
|
||||
val shouldPromptTrackingUpdate = tracks.any { track -> maxChapterNumber > track.lastChapterRead }
|
||||
|
||||
if (!shouldPromptTrackingUpdate) return@launchIO
|
||||
val formattedChapterNumber = maxChapterNumber.toInt()
|
||||
|
||||
val result = snackbarHostState.showSnackbar(
|
||||
message = context.stringResource(MR.strings.confirm_tracker_update, formattedChapterNumber),
|
||||
message = context.stringResource(MR.strings.confirm_tracker_update, maxChapterNumber.toInt()),
|
||||
actionLabel = context.stringResource(MR.strings.action_ok),
|
||||
duration = SnackbarDuration.Short,
|
||||
withDismissAction = true,
|
||||
@@ -742,7 +742,6 @@ class MangaScreenModel(
|
||||
trackChapter.await(context, mangaId, maxChapterNumber)
|
||||
}
|
||||
}
|
||||
toggleAllSelection(false)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user