From e4d6e61582ad78b95bb4dd4497e430eb9025b968 Mon Sep 17 00:00:00 2001 From: "maarten.vercruysse" Date: Sun, 7 Apr 2024 21:36:34 +0200 Subject: [PATCH] Fix Saved comments footer empty space doesn't open post --- .../java/com/jerboa/model/SiteViewModel.kt | 20 +++++++------------ .../ui/components/comment/CommentNode.kt | 10 ++++++++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/com/jerboa/model/SiteViewModel.kt b/app/src/main/java/com/jerboa/model/SiteViewModel.kt index 4a14f2e4d..a61f37d27 100644 --- a/app/src/main/java/com/jerboa/model/SiteViewModel.kt +++ b/app/src/main/java/com/jerboa/model/SiteViewModel.kt @@ -121,29 +121,23 @@ class SiteViewModel(private val accountRepository: AccountRepository) : ViewMode fun fetchUnreadCounts() { viewModelScope.launch { - viewModelScope.launch { - unreadCountRes = ApiState.Loading - unreadCountRes = API.getInstance().getUnreadCount().toApiState() - } + unreadCountRes = ApiState.Loading + unreadCountRes = API.getInstance().getUnreadCount().toApiState() } } fun fetchUnreadAppCount() { viewModelScope.launch { - viewModelScope.launch { - unreadAppCountRes = ApiState.Loading - unreadAppCountRes = - API.getInstance().getUnreadRegistrationApplicationCount().toApiState() - } + unreadAppCountRes = ApiState.Loading + unreadAppCountRes = + API.getInstance().getUnreadRegistrationApplicationCount().toApiState() } } fun fetchUnreadReportCount() { viewModelScope.launch { - viewModelScope.launch { - unreadReportCountRes = ApiState.Loading - unreadReportCountRes = API.getInstance().getReportCount(GetReportCount()).toApiState() - } + unreadReportCountRes = ApiState.Loading + unreadReportCountRes = API.getInstance().getReportCount(GetReportCount()).toApiState() } } diff --git a/app/src/main/java/com/jerboa/ui/components/comment/CommentNode.kt b/app/src/main/java/com/jerboa/ui/components/comment/CommentNode.kt index 2779f0776..43e1e0581 100644 --- a/app/src/main/java/com/jerboa/ui/components/comment/CommentNode.kt +++ b/app/src/main/java/com/jerboa/ui/components/comment/CommentNode.kt @@ -397,8 +397,14 @@ fun LazyListScope.commentNodeItem( onPersonClick = onPersonClick, onViewVotesClick = onViewVotesClick, onBlockCreatorClick = onBlockCreatorClick, - onClick = { - toggleExpanded(commentId) + onClick = if (isFlat) { + { + onCommentClick(commentView) + } + } else { + { + toggleExpanded(commentId) + } }, onLongClick = { toggleActionBar(commentId)