Fix reset of scroll position

This commit is contained in:
laurenspriem
2025-06-24 17:27:45 +05:30
parent 67f43453aa
commit 4832739ff8

View File

@@ -336,6 +336,7 @@ class _PeopleSectionAllWidgetState extends State<PeopleSectionAllWidget> {
final streamSubscriptions = <StreamSubscription>[];
bool _showingAllFaces = false;
bool _isLoaded = false;
bool _isInitialLoad = true;
bool get _showMoreLessOption => !widget.namedOnly && extraFaces.isNotEmpty;
@@ -349,6 +350,7 @@ class _PeopleSectionAllWidgetState extends State<PeopleSectionAllWidget> {
streamSubscriptions.add(
stream.listen((event) async {
setState(() {
_isInitialLoad = false;
_isLoaded = false;
sectionData = getResults();
});
@@ -413,7 +415,9 @@ class _PeopleSectionAllWidgetState extends State<PeopleSectionAllWidget> {
return FutureBuilder<List<GenericSearchResult>>(
future: sectionData,
builder: (context, snapshot) {
if (!_isLoaded && snapshot.connectionState == ConnectionState.waiting) {
if (!_isLoaded &&
snapshot.connectionState == ConnectionState.waiting &&
_isInitialLoad) {
return const Center(child: EnteLoadingWidget());
} else if (snapshot.hasError) {
return const Center(child: Icon(Icons.error_outline_rounded));