fix: on join activity with role, preload activity participants list to get accurate list of assigned roles (#4326)

This commit is contained in:
ggurdin 2025-10-10 11:35:11 -04:00 committed by GitHub
parent 2ab664ecea
commit df4410e85d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -53,7 +53,6 @@ class _ActivityStatsButtonState extends State<ActivityStatsButton> {
u.state.type == PangeaEventTypes.activityRole,
)
.listen((_) {
debugPrint("ON ROOM STATE");
_showStatsMenuDropdownInstructions();
});
}

View file

@ -311,6 +311,15 @@ class ActivitySessionStartController extends State<ActivitySessionStartPage>
}
try {
// Since the method that check for assigned roles needs to know each
// participant's membership status (to exclude left users), we need
// to pre-load the room's participants list.
activityRoom!.requestParticipants(
[Membership.join, Membership.invite, Membership.knock],
false,
true,
);
await activityRoom!.joinActivity(
activity!.roles[_selectedRoleId!]!,
);