fix: update renderlist after asset deleted (#16786)

This commit is contained in:
Saschl 2025-03-28 19:34:19 +01:00 committed by GitHub
parent d2bcf5d716
commit 6419ac74af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -263,10 +263,6 @@ 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 =

View File

@ -95,6 +95,11 @@ class BottomGalleryBar extends ConsumerWidget {
totalAssets.value -= 1;
}
if (isDeleted) {
ref
.read(currentAssetProvider.notifier)
.set(renderList.loadAsset(assetIndex.value));
}
return isDeleted;
}