mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
do no animate tabs on load (#351)
This commit is contained in:
parent
1591a0ca26
commit
b278d11aca
@ -70,6 +70,7 @@ const TabBar = React.memo(({ workspace }: TabBarProps) => {
|
||||
const tabWidthRef = useRef<number>(TAB_DEFAULT_WIDTH);
|
||||
const scrollableRef = useRef<boolean>(false);
|
||||
const updateStatusButtonRef = useRef<HTMLButtonElement>(null);
|
||||
const prevAllLoadedRef = useRef<boolean>(false);
|
||||
|
||||
const windowData = useAtomValue(atoms.waveWindow);
|
||||
const { activetabid } = windowData;
|
||||
@ -202,8 +203,11 @@ const TabBar = React.memo(({ workspace }: TabBarProps) => {
|
||||
// Check if all tabs are loaded
|
||||
const allLoaded = tabIds.length > 0 && tabIds.every((id) => tabsLoaded[id]);
|
||||
if (allLoaded) {
|
||||
updateSizeAndPosition(newTabId === null);
|
||||
updateSizeAndPosition(newTabId === null && prevAllLoadedRef.current);
|
||||
saveTabsPosition();
|
||||
if (!prevAllLoadedRef.current) {
|
||||
prevAllLoadedRef.current = true;
|
||||
}
|
||||
}
|
||||
}, [tabIds, tabsLoaded, newTabId, handleResizeTabs, saveTabsPosition]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user