fix(mobile): use immutable cache keys for local images (#17736)

fix(mobile): usse immutable cache keys for local images
This commit is contained in:
Łukasz Wawrzyk 2025-04-21 20:00:46 +02:00 committed by GitHub
parent b71039e83c
commit 010b144754
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View File

@ -106,12 +106,12 @@ class ImmichLocalImageProvider extends ImageProvider<ImmichLocalImageProvider> {
bool operator ==(Object other) { bool operator ==(Object other) {
if (identical(this, other)) return true; if (identical(this, other)) return true;
if (other is ImmichLocalImageProvider) { if (other is ImmichLocalImageProvider) {
return asset == other.asset; return asset.id == other.asset.id;
} }
return false; return false;
} }
@override @override
int get hashCode => asset.hashCode; int get hashCode => asset.id.hashCode;
} }

View File

@ -89,11 +89,14 @@ class ImmichLocalThumbnailProvider
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
if (other is! ImmichLocalThumbnailProvider) return false;
if (identical(this, other)) return true; if (identical(this, other)) return true;
return asset == other.asset; if (other is ImmichLocalThumbnailProvider) {
return asset.id == other.asset.id;
}
return false;
} }
@override @override
int get hashCode => asset.hashCode; int get hashCode => asset.id.hashCode;
} }