Skip to content

Commit a1bdb6b

Browse files
authored
fixed empty roles list in call participant state (#757)
1 parent 5ad7064 commit a1bdb6b

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

dogfooding/lib/screens/call_participants_list.dart

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,19 @@ class CallParticipantsList extends StatelessWidget {
7474
child: Padding(
7575
padding:
7676
const EdgeInsets.symmetric(horizontal: 16),
77-
child: Text(
78-
participant.name,
79-
overflow: TextOverflow.ellipsis,
77+
child: Column(
78+
crossAxisAlignment: CrossAxisAlignment.start,
79+
children: [
80+
Text(
81+
participant.name,
82+
overflow: TextOverflow.ellipsis,
83+
),
84+
Text(
85+
participant.roles.join(', '),
86+
style: textTheme.footnoteItalic,
87+
overflow: TextOverflow.ellipsis,
88+
),
89+
],
8090
),
8191
),
8292
),

packages/stream_video/lib/src/sfu/sfu_extensions.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extension SfuParticipantX on SfuParticipant {
77
CallParticipantState toParticipantState(CallState state) {
88
final isLocal = userId == state.currentUserId;
99
final existing = state.callParticipants.firstWhereOrNull(
10-
(it) => it.userId == userId && it.sessionId == sessionId,
10+
(it) => it.userId == userId,
1111
);
1212

1313
final existingName = existing?.name ?? '';
@@ -16,7 +16,7 @@ extension SfuParticipantX on SfuParticipant {
1616

1717
return CallParticipantState(
1818
userId: userId,
19-
roles: existingRoles,
19+
roles: roles.isNotEmpty ? roles : existingRoles,
2020
name: userName.ifEmpty(() => existingName),
2121
custom: custom,
2222
image: userImage.ifEmpty(() => existingImage),

0 commit comments

Comments
 (0)