fix(mobile): images rendered twice due to rebuild (#4060)

* fix(mobile): images rendered twice due to rebuild

* fix bottom sheet triggered multiple times
This commit is contained in:
Fynn Petersen-Frey
2023-09-12 15:43:15 +02:00
committed by GitHub
parent d023d5b6b4
commit bd226e9e2c
3 changed files with 25 additions and 24 deletions

View File

@@ -64,9 +64,8 @@ class GalleryViewerPage extends HookConsumerWidget {
final authToken = 'Bearer ${Store.get(StoreKey.accessToken)}';
final currentIndex = useState(initialIndex);
final currentAsset = loadAsset(currentIndex.value);
final watchedAsset = ref.watch(assetDetailProvider(currentAsset));
Asset asset() => watchedAsset.value ?? currentAsset;
Asset asset() => currentAsset;
useEffect(
() {
@@ -194,7 +193,7 @@ class GalleryViewerPage extends HookConsumerWidget {
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
child: ExifBottomSheet(asset: asset()),
child: ExifBottomSheet(asset: currentAsset),
);
},
);