fix: in public course preview, filter non-joined members from participant count (#5812)
This commit is contained in:
parent
2a17b401ee
commit
77559b9838
2 changed files with 5 additions and 1 deletions
|
|
@ -105,6 +105,10 @@ class RoomSummaryResponse {
|
|||
);
|
||||
}
|
||||
|
||||
int get joinedMemberCount => membershipSummary.values
|
||||
.where((membership) => membership == Membership.join.name)
|
||||
.length;
|
||||
|
||||
factory RoomSummaryResponse.fromJson(Map<String, dynamic> json) {
|
||||
final planEntry =
|
||||
json[PangeaEventTypes.activityPlan]?["default"]?["content"];
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class PublicCoursePreviewView extends StatelessWidget {
|
|||
icon: Icons.person,
|
||||
text: L10n.of(context)
|
||||
.countParticipants(
|
||||
summary.membershipSummary.length,
|
||||
summary.joinedMemberCount,
|
||||
),
|
||||
fontSize: descFontSize,
|
||||
iconSize: smallIconSize,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue