Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mobile): Removes deleted asset from gallery pages #1837

Merged
merged 1 commit into from
Feb 23, 2023

Conversation

martyfuhry
Copy link
Contributor

Fixes a bug where deleting an image from the gallery view would advance the page view controller, but not remove it from the page view. That is, you could just page back to it and it would still be there.

@vercel
Copy link

vercel bot commented Feb 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
immich ⬜️ Ignored (Inspect) Feb 22, 2023 at 5:50PM (UTC)

@@ -31,7 +31,7 @@ import 'package:openapi/api.dart' as api;

// ignore: must_be_immutable
class GalleryViewerPage extends HookConsumerWidget {
late List<Asset> assetList;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why changing late to final would fix the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has no effect here. It doesn't fix the issue, it just should not have been assigned late as there is no case it is allowed to be null. Unless I'm massively misunderstanding something here...

late tells the compiler that while this variable is not guarenteed to be non-null at initialization, it will be initialized later (hence, late) to something non-null. It's dangerous and usually unnecessary. In this case, this is just final. The fix was removing the asset from the list lower down.

@alextran1502 alextran1502 merged commit 98a8be8 into main Feb 23, 2023
@alextran1502 alextran1502 deleted the fix/delete-asset-removes-from-gallery-list branch February 23, 2023 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants