Fix running StartupSync before finishing query

This commit is contained in:
Ming Ming 2022-09-23 17:27:58 +08:00
parent 7f50bcaa58
commit 3308e91133

View file

@ -382,9 +382,10 @@ class _HomePhotosState extends State<HomePhotos>
void _onStateChange(BuildContext context, ScanAccountDirBlocState state) { void _onStateChange(BuildContext context, ScanAccountDirBlocState state) {
if (state is ScanAccountDirBlocInit) { if (state is ScanAccountDirBlocInit) {
itemStreamListItems = []; itemStreamListItems = [];
} else if (state is ScanAccountDirBlocSuccess || } else if (state is ScanAccountDirBlocSuccess) {
state is ScanAccountDirBlocLoading) {
_transformItems(state.files, isPostSuccess: true); _transformItems(state.files, isPostSuccess: true);
} else if (state is ScanAccountDirBlocLoading) {
_transformItems(state.files);
} else if (state is ScanAccountDirBlocFailure) { } else if (state is ScanAccountDirBlocFailure) {
_isScrollbarVisible = true; _isScrollbarVisible = true;
_transformItems(state.files); _transformItems(state.files);