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
Santo Shakil 2026-05-09 00:55:03 +06:00 committed by GitHub
parent 832ed4d015
commit 7c6750941e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -74,6 +74,7 @@ class _AlbumSyncActionButtonState extends ConsumerState<_AlbumSyncActionButton>
} catch (_) { } catch (_) {
} finally { } finally {
Future.delayed(const Duration(seconds: 1), () { Future.delayed(const Duration(seconds: 1), () {
if (!mounted) return;
setState(() { setState(() {
isAlbumSyncInProgress = false; isAlbumSyncInProgress = false;
}); });