fix(premeeting): call hooks before any conditional block in ConnectionStatus (#11136)
This commit is contained in:
parent
fbe15aaa47
commit
64d32a5005
|
@ -148,11 +148,6 @@ const CONNECTION_TYPE_MAP = {
|
|||
function ConnectionStatus({ connectionDetails, t, connectionType }: Props) {
|
||||
const classes = useStyles();
|
||||
|
||||
if (connectionType === CONNECTION_TYPE.NONE) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { connectionClass, icon, connectionText } = CONNECTION_TYPE_MAP[connectionType];
|
||||
const [ showDetails, toggleDetails ] = useState(false);
|
||||
const arrowClassName = showDetails
|
||||
? 'con-status-arrow con-status-arrow--up'
|
||||
|
@ -174,6 +169,12 @@ function ConnectionStatus({ connectionDetails, t, connectionType }: Props) {
|
|||
}
|
||||
}, [ showDetails, toggleDetails ]);
|
||||
|
||||
if (connectionType === CONNECTION_TYPE.NONE) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { connectionClass, icon, connectionText } = CONNECTION_TYPE_MAP[connectionType];
|
||||
|
||||
return (
|
||||
<div className = { classes.connectionStatus }>
|
||||
<div
|
||||
|
|
Loading…
Reference in New Issue