Fix calling setState after widget dismissed

This commit is contained in:
Ming Ming 2021-10-25 18:46:12 +08:00
parent 9b9e737a95
commit 3fcb4e2090

View file

@ -430,9 +430,11 @@ class _HomePhotosState extends State<HomePhotos>
final shareRepo = ShareRepo(ShareRemoteDataSource());
await AddToAlbum(albumRepo, shareRepo)(
widget.account, value, selected);
setState(() {
clearSelectedItems();
});
if (mounted) {
setState(() {
clearSelectedItems();
});
}
},
null,
L10n.global().addSelectedToAlbumSuccessNotification(value.name),