mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
parent
c6e5f8abd9
commit
9caa0d147b
1 changed files with 7 additions and 3 deletions
|
@ -89,10 +89,14 @@ object LibraryTab : Tab {
|
||||||
|
|
||||||
val snackbarHostState = remember { SnackbarHostState() }
|
val snackbarHostState = remember { SnackbarHostState() }
|
||||||
|
|
||||||
val onClickRefresh: (Category?) -> Boolean = {
|
val onClickRefresh: (Category?) -> Boolean = { category ->
|
||||||
val started = LibraryUpdateJob.startNow(context, it)
|
val started = LibraryUpdateJob.startNow(context, category)
|
||||||
scope.launch {
|
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))
|
snackbarHostState.showSnackbar(context.getString(msgRes))
|
||||||
}
|
}
|
||||||
started
|
started
|
||||||
|
|
Loading…
Reference in a new issue