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

Small cleaning

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-03-18 12:51:37 +03:00
parent b3de1791e0
commit 2a568d0fda

View File

@ -24,7 +24,7 @@ export interface DockTabsProps {
export const DockTabs = ({ tabs, autoFocus, selectedTab, onChangeTab }: DockTabsProps) => {
const elem = useRef<HTMLDivElement>();
const minTabSize = useRef<number>(0);
const [showScrollbar, setShowScrollbar] = useState<boolean>(false);
const [showScrollbar, setShowScrollbar] = useState(false);
const getTabElements = (): HTMLDivElement[] => {
return Array.from(elem.current?.querySelectorAll(".Tabs .Tab"));
@ -75,10 +75,6 @@ export const DockTabs = ({ tabs, autoFocus, selectedTab, onChangeTab }: DockTabs
minTabSize.current = cssVars.get("--min-tab-width").valueOf();
});
useEffect(() => {
updateScrollbarVisibility();
}, [tabs]);
useResizeObserver(elem.current, () => {
scrollActiveTabIntoView();
updateScrollbarVisibility();