add mounted check
This commit is contained in:
1 parent
cc8984ca1b
commit
62f53ce327
2 files changed
+2
-2
No files matched your search
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user