fix blocking accounts in thread view (#2988)

This commit is contained in:
Konrad Pozniak 2022-12-05 14:44:52 +01:00 committed by GitHub
parent 0b921f3c26
commit f3962058dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -169,6 +169,12 @@ class ViewThreadFragment : SFragment(), OnRefreshListener, StatusActionListener,
}
}
is ThreadUiState.Success -> {
if (uiState.statuses.none { viewData -> viewData.isDetailed }) {
// no detailed statuses available, e.g. because author is blocked
activity?.finish()
return@collect
}
adapter.submitList(uiState.statuses) {
if (viewModel.isInitialLoad) {
viewModel.isInitialLoad = false

View file

@ -262,7 +262,7 @@ class ViewThreadViewModel @Inject constructor(
updateSuccess { uiState ->
uiState.copy(
statuses = uiState.statuses.filter { viewData ->
viewData.status.account.id == accountId
viewData.status.account.id != accountId
}
)
}