From 9caa0d147b9d993daf173dbd7d756ab3372943bc Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 5 Mar 2023 11:07:33 -0500 Subject: [PATCH] Show proper message when doing global update Fixes #9170 --- .../java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt index 2b8e10108..635f2f04d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt @@ -89,10 +89,14 @@ object LibraryTab : Tab { val snackbarHostState = remember { SnackbarHostState() } - val onClickRefresh: (Category?) -> Boolean = { - val started = LibraryUpdateJob.startNow(context, it) + val onClickRefresh: (Category?) -> Boolean = { category -> + val started = LibraryUpdateJob.startNow(context, category) scope.launch { - val msgRes = if (started) R.string.updating_category else R.string.update_already_running + val msgRes = when { + !started -> R.string.update_already_running + category != null -> R.string.updating_category + else -> R.string.updating_library + } snackbarHostState.showSnackbar(context.getString(msgRes)) } started