Skip to content

Commit

Permalink
fix: add some comments to explain the function of code; when showing …
Browse files Browse the repository at this point in the history
…only DZ, the state will not be reset since the first floor is always on the first page.
  • Loading branch information
AInfinity-LilacDream committed Jan 4, 2025
1 parent 22e00c4 commit 8ffd003
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/page/forum/hole_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,14 @@ class BBSPostDetailState extends State<BBSPostDetail> {
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),
Expand Down

0 comments on commit 8ffd003

Please sign in to comment.