add mounted check

This commit is contained in:
Fabian Freund
2025-12-30 06:56:08 +01:00
parent cc8984ca1b
commit 62f53ce327
2 changed files with 2 additions and 2 deletions
@@ -226,7 +226,7 @@ class MlDownloadState extends _$MlDownloadState {
if (progress.status == MlProgressStatus.done) {
// Keep showing for 2 seconds after completion
Future.delayed(const Duration(seconds: 2), () {
if (state != null && state!.id == progress.id) {
if (ref.mounted && state != null && state!.id == progress.id) {
state = null;
}
});
@@ -379,7 +379,7 @@ final class MlDownloadStateProvider
}
}
String _$mlDownloadStateHash() => r'10be3767d448ea8fca8bf35578c343f3b9ddbb4e';
String _$mlDownloadStateHash() => r'837e73d9c0f8ac5c25e075417b22ff16cfcdf818';
/// Tracks active ML model downloads