fix(mobile): deletion of single assets (#15597)

fix: set asset in currentassetprovider on image load

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Saschl 2025-01-24 18:47:54 +01:00 committed by GitHub
parent c0210bd6c0
commit 3c1fa22109
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -262,6 +262,11 @@ class GalleryViewerPage extends HookConsumerWidget {
PhotoViewGalleryPageOptions buildAsset(BuildContext context, int index) {
var newAsset = loadAsset(index);
WidgetsBinding.instance.addPostFrameCallback((_) {
ref.read(currentAssetProvider.notifier).set(newAsset);
});
final stackId = newAsset.stackId;
if (stackId != null && currentIndex.value == index) {
final stackElements =