fix(mobile): mounted check before setState in album sync action (#28300)
_manualSyncAlbums fires a setState 1s after sync via Future.delayed with no mounted check. if the widget is gone by then, setState throws null check and the global error logger logs it severe.pull/28303/head
parent
832ed4d015
commit
7c6750941e
|
|
@ -74,6 +74,7 @@ class _AlbumSyncActionButtonState extends ConsumerState<_AlbumSyncActionButton>
|
|||
} catch (_) {
|
||||
} finally {
|
||||
Future.delayed(const Duration(seconds: 1), () {
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
isAlbumSyncInProgress = false;
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue