Unverified Commit 64d32a50 authored by Shahab's avatar Shahab Committed by GitHub
Browse files

fix(premeeting): call hooks before any conditional block in ConnectionStatus (#11136)

parent fbe15aaa
No related merge requests found
Showing with 6 additions and 5 deletions
......@@ -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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment