fix blocking accounts in thread view (#2988)
This commit is contained in:
parent
0b921f3c26
commit
f3962058dc
2 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue