You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-15 11:01:52 +03:00
Use Set::size instead of Array.from()::length
This commit is contained in:
@ -189,10 +189,6 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get pendingActionsCount(): number {
|
|
||||||
return Array.from(this.state.pendingRoomJoin).length;
|
|
||||||
}
|
|
||||||
|
|
||||||
private onOpenMenuClick = (ev: React.MouseEvent) => {
|
private onOpenMenuClick = (ev: React.MouseEvent) => {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
@ -654,11 +650,11 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
|||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
{name}
|
{name}
|
||||||
{this.pendingActionsCount > 0 && (
|
{this.state.pendingRoomJoin.size > 0 && (
|
||||||
<InlineSpinner>
|
<InlineSpinner>
|
||||||
<TooltipButton helpText={_t(
|
<TooltipButton helpText={_t(
|
||||||
"Currently joining %(count)s rooms",
|
"Currently joining %(count)s rooms",
|
||||||
{ count: this.pendingActionsCount },
|
{ count: this.state.pendingRoomJoin.size },
|
||||||
)} />
|
)} />
|
||||||
</InlineSpinner>
|
</InlineSpinner>
|
||||||
)}
|
)}
|
||||||
|
Reference in New Issue
Block a user