From 386afcd068708adbf09db6f50c4afc876d220901 Mon Sep 17 00:00:00 2001 From: HeroBrine1st Erquilenne Date: Thu, 2 Jan 2025 17:44:59 +0300 Subject: [PATCH] Add retry buttons on refresh errors --- .../e621/ui/screen/post/CommentsBottomSheetContent.kt | 2 +- .../main/java/ru/herobrine1st/e621/ui/screen/posts/Posts.kt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ru/herobrine1st/e621/ui/screen/post/CommentsBottomSheetContent.kt b/app/src/main/java/ru/herobrine1st/e621/ui/screen/post/CommentsBottomSheetContent.kt index 48dd062f..61c67a00 100644 --- a/app/src/main/java/ru/herobrine1st/e621/ui/screen/post/CommentsBottomSheetContent.kt +++ b/app/src/main/java/ru/herobrine1st/e621/ui/screen/post/CommentsBottomSheetContent.kt @@ -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)) } diff --git a/app/src/main/java/ru/herobrine1st/e621/ui/screen/posts/Posts.kt b/app/src/main/java/ru/herobrine1st/e621/ui/screen/posts/Posts.kt index 8818436a..4941b0ed 100644 --- a/app/src/main/java/ru/herobrine1st/e621/ui/screen/posts/Posts.kt +++ b/app/src/main/java/ru/herobrine1st/e621/ui/screen/posts/Posts.kt @@ -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))