From 481d941b65913385d46d0eb73685db5b9b7375cb Mon Sep 17 00:00:00 2001 From: thororen <78185467+thororen1234@users.noreply.github.com> Date: Sat, 26 Sep 2026 21:25:27 -0400 Subject: [PATCH] ChannelTabs: Dont Use Observer --- .../components/ChannelTabsContainer.tsx | 25 +------------------ src/equicordplugins/channelTabs/style.css | 6 +++++ 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/equicordplugins/channelTabs/components/ChannelTabsContainer.tsx b/src/equicordplugins/channelTabs/components/ChannelTabsContainer.tsx index be300fc28..96633e35b 100644 --- a/src/equicordplugins/channelTabs/components/ChannelTabsContainer.tsx +++ b/src/equicordplugins/channelTabs/components/ChannelTabsContainer.tsx @@ -28,7 +28,6 @@ const cl = classNameFactory("vc-channeltabs-"); export default function ChannelsTabsContainer(props: BasicChannelTabsProps) { const [userId, setUserId] = useState(""); - const [tabsOverflow, setTabsOverflow] = useState(false); const { showBookmarkBar, widerTabsAndBookmarks, @@ -107,7 +106,6 @@ export default function ChannelsTabsContainer(props: BasicChannelTabsProps) { }, []); const ref = useRef(null); - const scrollerRef = useRef(null); const currentChannelRef = useRef(props); currentChannelRef.current = props; @@ -141,26 +139,6 @@ export default function ChannelsTabsContainer(props: BasicChannelTabsProps) { useEffect(() => { _update(); }, [widerTabsAndBookmarks]); - useEffect(() => { - const scroller = scrollerRef.current; - if (!scroller) return; - - const checkOverflow = () => { - if (!newTabButtonBehavior) { - setTabsOverflow(true); - return; - } - const overflow = scroller.scrollWidth > scroller.clientWidth; - setTabsOverflow(overflow); - }; - - checkOverflow(); - - const observer = new ResizeObserver(checkOverflow); - observer.observe(scroller); - - return () => observer.disconnect(); - }, [openedTabs.length, newTabButtonBehavior]); useEffect(() => { const matchesKeybind = (event: KeyboardEvent, keybindString: string): boolean => { @@ -296,7 +274,7 @@ export default function ChannelsTabsContainer(props: BasicChannelTabsProps) { if (isFullscreen) return null; - const shouldFollowNewTabButton = newTabButtonBehavior && !tabsOverflow; + const shouldFollowNewTabButton = newTabButtonBehavior; const newTabButton = (