Skip to content

Commit

Permalink
fix: (1) when filtering posts by a specified user, the post page shou…
Browse files Browse the repository at this point in the history
…ld not refresh itself; (2) the status description and actual logic of the "show this user" are inconsistent

(1) This causes the page to become blank when users want to filter by posters only in the deeper levels of the thread.

(2) When a user filters by the poster of a certain post, long-pressing on another post displays "Show all posts," but clicking it actually filters by the user of that other post.
  • Loading branch information
w568w committed Jan 1, 2025
1 parent 7a062a1 commit 3cb7ca1
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions lib/page/forum/hole_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,10 @@ class BBSPostDetailState extends State<BBSPostDetail> {
setState(() {
if ((_renderModel as Normal).selectedPerson != hole.floors?.first_floor?.anonyname) {
(_renderModel as Normal).selectedPerson = hole.floors?.first_floor?.anonyname;
}
else {
} else {
(_renderModel as Normal).selectedPerson = null;
}
});
refreshListView();
}),
PopupMenuOption(
label: _multiSelectMode
Expand Down Expand Up @@ -887,16 +885,15 @@ class BBSPostDetailState extends State<BBSPostDetail> {
PlatformContextMenuItem(
menuContext: menuContext,
onPressed: () async {
if ((_renderModel as Normal).selectedPerson != null) {
(_renderModel as Normal).selectedPerson = null;
refreshListView();
} else {
setState(() =>
(_renderModel as Normal).selectedPerson = e.anonyname);
refreshListView();
}
setState(() {
if ((_renderModel as Normal).selectedPerson != null) {
(_renderModel as Normal).selectedPerson = null;
} else {
(_renderModel as Normal).selectedPerson = e.anonyname;
}
});
},
child: Text((_renderModel as Normal).selectedPerson == e.anonyname ? S.of(context).show_all_replies : S.of(context).show_this_person),
child: Text((_renderModel as Normal).selectedPerson != null ? S.of(context).show_all_replies : S.of(context).show_this_person),
),
PlatformContextMenuItem(
menuContext: menuContext,
Expand Down

0 comments on commit 3cb7ca1

Please sign in to comment.