fix crash when user clicks url on in partially loaded thread (#3174)
This commit is contained in:
parent
2df6a83e42
commit
8058c4bc79
1 changed files with 6 additions and 2 deletions
|
@ -180,9 +180,13 @@ class ViewThreadViewModel @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
fun detailedStatus(): StatusViewData.Concrete? {
|
fun detailedStatus(): StatusViewData.Concrete? {
|
||||||
return (_uiState.value as ThreadUiState.Success?)?.statusViewData?.find { status ->
|
return when (val uiState = _uiState.value) {
|
||||||
|
is ThreadUiState.Success -> uiState.statusViewData.find { status ->
|
||||||
status.isDetailed
|
status.isDetailed
|
||||||
}
|
}
|
||||||
|
is ThreadUiState.LoadingThread -> uiState.statusViewDatum
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun reblog(reblog: Boolean, status: StatusViewData.Concrete): Job = viewModelScope.launch {
|
fun reblog(reblog: Boolean, status: StatusViewData.Concrete): Job = viewModelScope.launch {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue