Skip to content

Commit

Permalink
fix(mobile): deletion of single assets (#15597)
Browse files Browse the repository at this point in the history
fix: set asset in currentassetprovider on image load

Co-authored-by: Alex <[email protected]>
  • Loading branch information
Saschl and alextran1502 authored Jan 24, 2025
1 parent c0210bd commit 3c1fa22
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mobile/lib/pages/common/gallery_viewer.page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 3c1fa22

Please sign in to comment.