diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentsViewModel.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentsViewModel.kt index 9e5e96eb..839369ac 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentsViewModel.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/CommentsViewModel.kt @@ -45,6 +45,10 @@ constructor( var postDetails by mutableStateOf(NetworkState.Loading) suspend fun loadPostDetails(postId: String) { + if (postDetails is NetworkState.Error) { + // If the post details failed to load previously, reset the state to loading + postDetails = NetworkState.Loading + } postDetails = runSuspendCatching { withContext(ioDispatcher) {