Skip to content

Commit

Permalink
DROID-2815 Editor | Tech | Increase timeout limit when loading images…
Browse files Browse the repository at this point in the history
… for image block (#1912)
  • Loading branch information
uburoiubu authored Dec 12, 2024
1 parent 1511bab commit d711e84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Picture(val binding: ItemBlockPictureBinding) : Media(binding.root), Decor
isFirstResource: Boolean
): Boolean {
error.visible()
Timber.w(e, "Error while loading picture")
Timber.w(e, "Error while loading picture with url: $model")
return false
}

Expand All @@ -65,6 +65,7 @@ class Picture(val binding: ItemBlockPictureBinding) : Media(binding.root), Decor
.with(image)
.load(item.url)
.listener(listener)
.timeout(LOADING_TIMEOUT_IN_MILLIS)
.into(image)
}

Expand All @@ -88,4 +89,8 @@ class Picture(val binding: ItemBlockPictureBinding) : Media(binding.root), Decor
res = itemView.resources
)
}

companion object {
const val LOADING_TIMEOUT_IN_MILLIS = 30000
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ fun Block.Content.File.toPictureView(
val url = urlBuilder.getUrlForFileContent(this)
val targetId = this.targetObjectId
val struct = details.details[targetId]?.map
if (url != null && targetId != null && !struct.isNullOrEmpty()) {
val targetObject = ObjectWrapper.File(struct)
if (url != null && targetId != null) {
val targetObject = ObjectWrapper.File(struct.orEmpty())
BlockView.Media.Picture(
id = blockId,
targetObjectId = targetId,
Expand Down

0 comments on commit d711e84

Please sign in to comment.