Skip to content

Commit b0a89b5

Browse files
authored
🐛 Prevent race condition with paths (#342)
1 parent 7b4382e commit b0a89b5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ that can be found in the LICENSE file. -->
99
### New Features
1010

1111
- Add `initializeDelayDuration` for `DefaultAssetPickerProvider`. (#341)
12+
- Add `sortPathsByModifiedDate`. (#342)
1213

1314
## 8.0.0-dev.1
1415

lib/src/provider/asset_picker_provider.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,13 @@ class DefaultAssetPickerProvider
330330
} else {
331331
_paths[index] = wrapper;
332332
}
333-
// Use sync method to avoid unnecessary wait.
334-
getAssetCountFromPath(wrapper);
335-
getThumbnailFromPath(wrapper);
336333
}
337-
338334
// Sort path using sort path delegate.
339335
Singleton.sortPathDelegate.sort(_paths);
336+
// Use sync method to avoid unnecessary wait.
337+
_paths
338+
..forEach(getAssetCountFromPath)
339+
..forEach(getThumbnailFromPath);
340340

341341
// Set first path entity as current path entity.
342342
if (_paths.isNotEmpty) {

0 commit comments

Comments
 (0)