From 010b144754680f39979a65668311b5a5ffee2416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Wawrzyk?= Date: Mon, 21 Apr 2025 20:00:46 +0200 Subject: [PATCH] fix(mobile): use immutable cache keys for local images (#17736) fix(mobile): usse immutable cache keys for local images --- .../lib/providers/image/immich_local_image_provider.dart | 4 ++-- .../providers/image/immich_local_thumbnail_provider.dart | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mobile/lib/providers/image/immich_local_image_provider.dart b/mobile/lib/providers/image/immich_local_image_provider.dart index 36fd3334b9..34c3c94ded 100644 --- a/mobile/lib/providers/image/immich_local_image_provider.dart +++ b/mobile/lib/providers/image/immich_local_image_provider.dart @@ -106,12 +106,12 @@ class ImmichLocalImageProvider extends ImageProvider { bool operator ==(Object other) { if (identical(this, other)) return true; if (other is ImmichLocalImageProvider) { - return asset == other.asset; + return asset.id == other.asset.id; } return false; } @override - int get hashCode => asset.hashCode; + int get hashCode => asset.id.hashCode; } diff --git a/mobile/lib/providers/image/immich_local_thumbnail_provider.dart b/mobile/lib/providers/image/immich_local_thumbnail_provider.dart index 93245bd78e..9ccb127626 100644 --- a/mobile/lib/providers/image/immich_local_thumbnail_provider.dart +++ b/mobile/lib/providers/image/immich_local_thumbnail_provider.dart @@ -89,11 +89,14 @@ class ImmichLocalThumbnailProvider @override bool operator ==(Object other) { - if (other is! ImmichLocalThumbnailProvider) return false; if (identical(this, other)) return true; - return asset == other.asset; + if (other is ImmichLocalThumbnailProvider) { + return asset.id == other.asset.id; + } + + return false; } @override - int get hashCode => asset.hashCode; + int get hashCode => asset.id.hashCode; }