diff --git a/packages/bruno-app/src/components/RequestTabs/RequestTab/index.js b/packages/bruno-app/src/components/RequestTabs/RequestTab/index.js index 0861d873e..18633c2da 100644 --- a/packages/bruno-app/src/components/RequestTabs/RequestTab/index.js +++ b/packages/bruno-app/src/components/RequestTabs/RequestTab/index.js @@ -51,6 +51,10 @@ const RequestTab = ({ tab, collection, tabIndex, collectionRequestTabs, folderUi } }, [item]); + const hasChanges = useMemo(() => hasRequestChanges(item), [item]); + + const isWS = item?.type === 'ws-request'; + useEffect(() => { if (!item || !tabNameRef.current || !setHasOverflow) return; @@ -236,8 +240,6 @@ const RequestTab = ({ tab, collection, tabIndex, collectionRequestTabs, folderUi ); } - const hasChanges = useMemo(() => hasRequestChanges(item), [item]); - if (!item) { return ( { - const checkOverflow = () => { - if (tabNameRef.current && setHasOverflow) { - const hasOverflow = tabNameRef.current.scrollWidth > tabNameRef.current.clientWidth; - if (lastOverflowStateRef.current !== hasOverflow) { - lastOverflowStateRef.current = hasOverflow; - setHasOverflow(hasOverflow); - } - } - }; - - const timeoutId = setTimeout(checkOverflow, 0); - - const resizeObserver = new ResizeObserver(() => { - checkOverflow(); - }); - - if (tabNameRef.current) { - resizeObserver.observe(tabNameRef.current); - } - - return () => { - clearTimeout(timeoutId); - resizeObserver.disconnect(); - }; - }, [item.name, method, setHasOverflow]); - return ( {showConfirmClose && (