From 3308e911337ef23dfbbcdf4ee416145f04e92dca Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Fri, 23 Sep 2022 17:27:58 +0800 Subject: [PATCH] Fix running StartupSync before finishing query --- app/lib/widget/home_photos.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/lib/widget/home_photos.dart b/app/lib/widget/home_photos.dart index 4193eb7b..6dba57ee 100644 --- a/app/lib/widget/home_photos.dart +++ b/app/lib/widget/home_photos.dart @@ -382,9 +382,10 @@ class _HomePhotosState extends State void _onStateChange(BuildContext context, ScanAccountDirBlocState state) { if (state is ScanAccountDirBlocInit) { itemStreamListItems = []; - } else if (state is ScanAccountDirBlocSuccess || - state is ScanAccountDirBlocLoading) { + } else if (state is ScanAccountDirBlocSuccess) { _transformItems(state.files, isPostSuccess: true); + } else if (state is ScanAccountDirBlocLoading) { + _transformItems(state.files); } else if (state is ScanAccountDirBlocFailure) { _isScrollbarVisible = true; _transformItems(state.files);