Skip to content

Commit

Permalink
image cache includes signed token
Browse files Browse the repository at this point in the history
  • Loading branch information
WesleyEdwards committed Jun 4, 2024
1 parent bca23d9 commit 8a20501
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,7 @@ data class ImageVector(
)
}

class ImageRemote(val url: String) : ImageSource() {
private val before = url.substringBefore('?')
override fun hashCode(): Int = before.hashCode()
override fun equals(other: Any?): Boolean = other is ImageRemote && other.before == this.before
override fun toString(): String = "ImageRemote($url)"
}
data class ImageRemote(val url: String) : ImageSource()
data class ImageRaw(val data: Blob) : ImageSource()
data class ImageLocal(val file: FileReference) : ImageSource()
expect class ImageResource : ImageSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ actual inline var ImageView.source: ImageSource?
}
}
fun ImageView.setSrc(url: String) {
if(((native.lastElementChild as? HTMLImageElement)?.src?.substringBefore('?') ?: "") == url.substringBefore('?')) {
if(((native.lastElementChild as? HTMLImageElement)?.src ?: "") == url) {
(native.lastElementChild as? HTMLImageElement)?.style?.opacity = "1"
return
}
Expand Down

0 comments on commit 8a20501

Please sign in to comment.