better update condition

This commit is contained in:
mertalev 2025-07-26 16:47:11 -04:00
parent 60f396b599
commit 467acede2a
No known key found for this signature in database
GPG Key ID: DF6ABC77AAD98C95

View File

@ -105,8 +105,9 @@ class _ThumbnailState extends State<Thumbnail> {
void didUpdateWidget(Thumbnail oldWidget) {
super.didUpdateWidget(oldWidget);
if (oldWidget.imageProvider != widget.imageProvider ||
oldWidget.blurhash != widget.blurhash ||
(oldWidget.thumbhashMode == ThumbhashMode.disabled && oldWidget.thumbhashMode != ThumbhashMode.disabled)) {
(_providerImage == null &&
(widget.thumbhashMode != ThumbhashMode.disabled && oldWidget.blurhash != widget.blurhash) ||
(oldWidget.thumbhashMode == ThumbhashMode.disabled && widget.thumbhashMode != ThumbhashMode.disabled))) {
_loadImage();
}
}