From 8ffd00379d0219e3613e896643cae6f9f4b230ff Mon Sep 17 00:00:00 2001 From: "AInfinity_LilacDream." <1977741520@qq.com> Date: Sun, 5 Jan 2025 01:12:59 +0800 Subject: [PATCH] fix: add some comments to explain the function of code; when showing only DZ, the state will not be reset since the first floor is always on the first page. --- lib/page/forum/hole_detail.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/page/forum/hole_detail.dart b/lib/page/forum/hole_detail.dart index 7230abb0..9c14a758 100644 --- a/lib/page/forum/hole_detail.dart +++ b/lib/page/forum/hole_detail.dart @@ -418,7 +418,14 @@ class BBSPostDetailState extends State { backgroundColor: Theme.of(context).dialogBackgroundColor, onRefresh: () async { HapticFeedback.mediumImpact(); - (_renderModel as Normal).selectedPerson = null; + + // when users pull to refresh under "only this person" mode, + // the mode should be quited since if the floor is deep + // the initial request won't fetch them, and the page will be blank. + if ((_renderModel as Normal).selectedPerson != + (_renderModel as Normal).hole.floors?.first_floor?.anonyname) { + (_renderModel as Normal).selectedPerson = null; + } await refreshListView(); }, child: pagedListView),