Skip to content

Commit 356097f

Browse files
authored
Disallow showing one live user under "More" button (codesandbox#3976)
1 parent afccd7f commit 356097f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/app/src/app/pages/Sandbox/Editor/Header/CollaboratorHeads/CollaboratorHeads.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ export const CollaboratorHeads: FunctionComponent = () => {
145145
const firstLiveUsers = orderedLiveUsers.slice(0, USER_OVERFLOW_LIMIT);
146146
const restLiveUsers = orderedLiveUsers.slice(USER_OVERFLOW_LIMIT);
147147

148+
// It doesn't make sense to show a "More" button for live users if there's
149+
// only one in it.
150+
if (restLiveUsers.length === 1) {
151+
firstLiveUsers.push(restLiveUsers.pop());
152+
}
153+
148154
return (
149155
<Stack justify="center">
150156
<SingletonTooltip interactive>

0 commit comments

Comments
 (0)