1
0
mirror of https://github.com/immich-app/immich.git synced 2025-07-17 15:17:51 +02:00

fix: ensure buffer loaded before opening asset viewer (#19864)

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong
2025-07-11 01:51:50 +05:30
committed by GitHub
parent d178c52ba6
commit 70b73145f1

View File

@ -159,17 +159,18 @@ class _AssetTileWidget extends ConsumerWidget {
required this.assetIndex, required this.assetIndex,
}); });
void _handleOnTap( Future _handleOnTap(
BuildContext ctx, BuildContext ctx,
WidgetRef ref, WidgetRef ref,
int assetIndex, int assetIndex,
BaseAsset asset, BaseAsset asset,
) { ) async {
final multiSelectState = ref.read(multiSelectProvider); final multiSelectState = ref.read(multiSelectProvider);
if (multiSelectState.forceEnable || multiSelectState.isEnabled) { if (multiSelectState.forceEnable || multiSelectState.isEnabled) {
ref.read(multiSelectProvider.notifier).toggleAssetSelection(asset); ref.read(multiSelectProvider.notifier).toggleAssetSelection(asset);
} else { } else {
await ref.read(timelineServiceProvider).loadAssets(assetIndex, 1);
ctx.pushRoute( ctx.pushRoute(
AssetViewerRoute( AssetViewerRoute(
initialIndex: assetIndex, initialIndex: assetIndex,