1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Remove unneccessary code

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-08-18 09:52:43 -04:00
parent baf7bb41c3
commit 040120b0fb

View File

@ -41,19 +41,10 @@ export const Badge = withTooltip(observer(({
...elemProps
}: BadgeProps) => {
const elem = useRef<HTMLDivElement>(null);
const elemHasBeenSet = useRef(false);
const [isExpanded, setIsExpanded] = useState(false);
const [isExpandable, setIsExpandable] = useState(false);
useEffect(() => {
if (elemHasBeenSet.current) {
return;
}
if (elem.current) {
elemHasBeenSet.current = true;
}
const { clientWidth = 0, scrollWidth = 0 } = elem.current ?? {};
setIsExpandable(expandable && (clientWidth < scrollWidth));