Skip to content

Commit

Permalink
Fix some UI states was not updated during sync.
Browse files Browse the repository at this point in the history
  • Loading branch information
Swordfish90 committed May 9, 2024
1 parent 0fe86b8 commit 0569936
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ private fun HomeScreen(
messageId = R.string.home_empty_message,
actionId = R.string.home_empty_action,
onAction = onSetDirectoryClicked,
enabled = !state.indexInProgress
)
}
HomeRow(
Expand Down Expand Up @@ -177,7 +178,8 @@ private fun HomeNotification(
titleId: Int,
messageId: Int,
actionId: Int,
onAction: () -> Unit,
enabled: Boolean = true,
onAction: () -> Unit = { },
) {
ElevatedCard(
modifier =
Expand All @@ -203,6 +205,7 @@ private fun HomeNotification(
OutlinedButton(
modifier = Modifier.align(Alignment.End),
onClick = onAction,
enabled = enabled
) {
Text(stringResource(id = actionId))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fun SaveSyncSettingsScreen(
.value

val isSyncInProgress =
viewModel.indexingInProgress
viewModel.saveSyncInProgress
.collectAsState(true)
.value

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SaveSyncSettingsViewModel(
}
}

val indexingInProgress = PendingOperationsMonitor(getContext()).anyLibraryOperationInProgress()
val saveSyncInProgress = PendingOperationsMonitor(getContext()).anySaveOperationInProgress()

data class State(
val isConfigured: Boolean = false,
Expand Down

0 comments on commit 0569936

Please sign in to comment.