diff --git a/app/src/main/java/com/keylesspalace/tusky/components/viewthread/ViewThreadViewModel.kt b/app/src/main/java/com/keylesspalace/tusky/components/viewthread/ViewThreadViewModel.kt index 486eac66..181b2642 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/viewthread/ViewThreadViewModel.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/viewthread/ViewThreadViewModel.kt @@ -180,8 +180,12 @@ class ViewThreadViewModel @Inject constructor( } fun detailedStatus(): StatusViewData.Concrete? { - return (_uiState.value as ThreadUiState.Success?)?.statusViewData?.find { status -> - status.isDetailed + return when (val uiState = _uiState.value) { + is ThreadUiState.Success -> uiState.statusViewData.find { status -> + status.isDetailed + } + is ThreadUiState.LoadingThread -> uiState.statusViewDatum + else -> null } }