mirror of
https://github.com/immich-app/immich.git
synced 2025-02-11 01:18:24 -05:00
fix(mobile): Fixes prefer remote assets in thumbnail provider (#7485)
Fixes prefer remote assets in thumbnail provider Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
79442fc8a1
commit
d28abaad7b
2 changed files with 4 additions and 3 deletions
|
@ -58,9 +58,11 @@ class ImmichImage extends StatelessWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Whether to use the local asset image provider or a remote one
|
||||||
static bool useLocal(Asset asset) =>
|
static bool useLocal(Asset asset) =>
|
||||||
!asset.isRemote ||
|
!asset.isRemote ||
|
||||||
asset.isLocal && !Store.get(StoreKey.preferRemoteImage, false);
|
asset.isLocal && !Store.get(StoreKey.preferRemoteImage, false);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (asset == null) {
|
if (asset == null) {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import 'package:immich_mobile/modules/asset_viewer/image_providers/immich_local_
|
||||||
import 'package:immich_mobile/modules/asset_viewer/image_providers/immich_remote_image_provider.dart';
|
import 'package:immich_mobile/modules/asset_viewer/image_providers/immich_remote_image_provider.dart';
|
||||||
import 'package:immich_mobile/shared/models/asset.dart';
|
import 'package:immich_mobile/shared/models/asset.dart';
|
||||||
import 'package:immich_mobile/shared/ui/hooks/blurhash_hook.dart';
|
import 'package:immich_mobile/shared/ui/hooks/blurhash_hook.dart';
|
||||||
|
import 'package:immich_mobile/shared/ui/immich_image.dart';
|
||||||
import 'package:immich_mobile/shared/ui/thumbhash_placeholder.dart';
|
import 'package:immich_mobile/shared/ui/thumbhash_placeholder.dart';
|
||||||
import 'package:octo_image/octo_image.dart';
|
import 'package:octo_image/octo_image.dart';
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ class ImmichThumbnail extends HookWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useLocal(asset)) {
|
if (ImmichImage.useLocal(asset)) {
|
||||||
return ImmichLocalThumbnailProvider(
|
return ImmichLocalThumbnailProvider(
|
||||||
asset: asset,
|
asset: asset,
|
||||||
height: thumbnailSize,
|
height: thumbnailSize,
|
||||||
|
@ -57,8 +58,6 @@ class ImmichThumbnail extends HookWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool useLocal(Asset asset) => !asset.isRemote || asset.isLocal;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Uint8List? blurhash = useBlurHashRef(asset).value;
|
Uint8List? blurhash = useBlurHashRef(asset).value;
|
||||||
|
|
Loading…
Add table
Reference in a new issue