Skip to content

Commit

Permalink
Set contentIsReady flag if story attachment failed to download.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-signal authored and cody-signal committed Jul 21, 2022
1 parent 3c09655 commit eb18c07
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,8 @@ class StoryViewerPageFragment :
}

private fun markViewedIfAble() {
val post = if (viewModel.hasPost()) viewModel.getPost() else null
if (post?.content?.transferState == AttachmentDatabase.TRANSFER_PROGRESS_DONE) {
val post = viewModel.getPost() ?: return
if (post.content.transferState == AttachmentDatabase.TRANSFER_PROGRESS_DONE) {
if (isResumed) {
viewModel.markViewed(post)
}
Expand Down Expand Up @@ -707,7 +707,9 @@ class StoryViewerPageFragment :
}
AttachmentDatabase.TRANSFER_PROGRESS_FAILED -> {
storySlate.moveToState(StorySlateView.State.NOT_FOUND, post.id)
sharedViewModel.setContentIsReady()
viewModel.setIsDisplayingSlate(true)
markViewedIfAble()
}
}
}
Expand Down

0 comments on commit eb18c07

Please sign in to comment.