mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 12:08:56 +01:00
Fix notification and add visual cues when triggering a second update (#7783)
This commit is contained in:
@@ -83,9 +83,9 @@ fun UpdateScreen(
|
||||
val context = LocalContext.current
|
||||
|
||||
val onUpdateLibrary = {
|
||||
if (LibraryUpdateService.start(context)) {
|
||||
context.toast(R.string.updating_library)
|
||||
}
|
||||
val started = LibraryUpdateService.start(context)
|
||||
context.toast(if (started) R.string.updating_library else R.string.update_already_running)
|
||||
started
|
||||
}
|
||||
|
||||
val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(rememberTopAppBarState())
|
||||
@@ -97,7 +97,7 @@ fun UpdateScreen(
|
||||
UpdatesAppBar(
|
||||
incognitoMode = presenter.isIncognitoMode,
|
||||
downloadedOnlyMode = presenter.isDownloadOnly,
|
||||
onUpdateLibrary = onUpdateLibrary,
|
||||
onUpdateLibrary = { onUpdateLibrary() },
|
||||
actionModeCounter = presenter.selected.size,
|
||||
onSelectAll = { presenter.toggleAllSelection(true) },
|
||||
onInvertSelection = { presenter.invertSelection() },
|
||||
@@ -132,7 +132,8 @@ fun UpdateScreen(
|
||||
SwipeRefresh(
|
||||
state = rememberSwipeRefreshState(isRefreshing = isRefreshing),
|
||||
onRefresh = {
|
||||
onUpdateLibrary()
|
||||
val started = onUpdateLibrary()
|
||||
if (!started) return@SwipeRefresh
|
||||
scope.launch {
|
||||
// Fake refresh status but hide it after a second as it's a long running task
|
||||
isRefreshing = true
|
||||
|
||||
Reference in New Issue
Block a user