浏览代码

Show proper message when doing global update

Fixes #9170
arkon 2 年之前
父节点
当前提交
9caa0d147b
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 7 3
      app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryTab.kt

+ 7 - 3
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