Skip to content

Commit

Permalink
Add retry buttons on refresh errors
Browse files Browse the repository at this point in the history
  • Loading branch information
HeroBrine1st committed Jan 2, 2025
1 parent 9ef7300 commit 386afcd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fun CommentsBottomSheetContent(
Icon(Icons.Outlined.Error, contentDescription = null)
Text(stringResource(R.string.comments_load_failed))
Button(onClick = {
comments.refresh()
comments.retry()
}) {
Text(stringResource(R.string.retry))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ fun Posts(
is LoadState.Error -> {
Icon(Icons.Outlined.Error, contentDescription = null)
Text(stringResource(R.string.unknown_error))
Button(onClick = { posts.retry() }) {
Text(stringResource(R.string.retry))
}
}

LoadState.Complete -> Text(stringResource(R.string.empty_results))
Expand Down

0 comments on commit 386afcd

Please sign in to comment.