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()); final shareRepo = ShareRepo(ShareRemoteDataSource());
await AddToAlbum(albumRepo, shareRepo)( await AddToAlbum(albumRepo, shareRepo)(
widget.account, value, selected); widget.account, value, selected);
setState(() { if (mounted) {
clearSelectedItems(); setState(() {
}); clearSelectedItems();
});
}
}, },
null, null,
L10n.global().addSelectedToAlbumSuccessNotification(value.name), L10n.global().addSelectedToAlbumSuccessNotification(value.name),