Strictify voice-broadcast (#10393)
This commit is contained in:
parent
6d15b05b86
commit
aae9dfbb7d
7 changed files with 69 additions and 23 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2022 The Matrix.org Foundation C.I.C.
|
||||
Copyright 2022-2023 The Matrix.org Foundation C.I.C.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -27,8 +27,8 @@ interface Props {
|
|||
}
|
||||
|
||||
export const VoiceBroadcastPlaybackControl: React.FC<Props> = ({ onClick, state }) => {
|
||||
let controlIcon: ReactElement;
|
||||
let controlLabel: string;
|
||||
let controlIcon: ReactElement | null = null;
|
||||
let controlLabel: string | null = null;
|
||||
let className = "";
|
||||
|
||||
switch (state) {
|
||||
|
@ -49,5 +49,11 @@ export const VoiceBroadcastPlaybackControl: React.FC<Props> = ({ onClick, state
|
|||
break;
|
||||
}
|
||||
|
||||
return <VoiceBroadcastControl className={className} label={controlLabel} icon={controlIcon} onClick={onClick} />;
|
||||
if (controlIcon && controlLabel) {
|
||||
return (
|
||||
<VoiceBroadcastControl className={className} label={controlLabel} icon={controlIcon} onClick={onClick} />
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue