mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 01:06:21 +01:00
Fix data in bloc state can be modified outside
This commit is contained in:
parent
52e9618581
commit
8f8fa1db2a
3 changed files with 3 additions and 3 deletions
|
@ -131,7 +131,7 @@ class ListImportableAlbumBloc
|
|||
products.add(ev);
|
||||
// don't emit events too frequently
|
||||
if (++count >= 5) {
|
||||
emit(ListImportableAlbumBlocLoading(products));
|
||||
emit(ListImportableAlbumBlocLoading(products.toList()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -386,7 +386,7 @@ class ScanAccountDirBloc
|
|||
files.addAll(event);
|
||||
if (cache.isEmpty) {
|
||||
// only emit partial results if there's no cache
|
||||
emit(ScanAccountDirBlocLoading(files));
|
||||
emit(ScanAccountDirBlocLoading(files.toList()));
|
||||
}
|
||||
}
|
||||
_log.info(
|
||||
|
|
|
@ -93,7 +93,7 @@ class ScanLocalDirBloc
|
|||
final products = <LocalFile>[];
|
||||
for (final p in event.relativePaths) {
|
||||
if (shouldEmitIntermediate) {
|
||||
emit(ScanLocalDirBlocLoading(products));
|
||||
emit(ScanLocalDirBlocLoading(products.toList()));
|
||||
}
|
||||
final files = await ScanLocalDir(c)(p);
|
||||
products.addAll(files);
|
||||
|
|
Loading…
Reference in a new issue