diff --git a/src/components/logs-viewer/index.tsx b/src/components/logs-viewer/index.tsx index fe433b7e..594db0ac 100644 --- a/src/components/logs-viewer/index.tsx +++ b/src/components/logs-viewer/index.tsx @@ -23,7 +23,6 @@ const LogsViewer: React.FC = (props) => { const termwrapRef = useRef({}); const fitAddonRef = useRef({}); const cacheDataRef = useRef(null); - const isScorlling = useRef(false); const size = useSize(scroller); const updateContent = useCallback( @@ -53,11 +52,6 @@ const LogsViewer: React.FC = (props) => { }); }; - const scrollAnimation = () => { - window.requestAnimationFrame(() => { - termRef.current?.scrollToBottom(); - }); - }; const initTerm = () => { termRef.current?.dispose?.(); termRef.current = new Terminal({ @@ -72,7 +66,7 @@ const LogsViewer: React.FC = (props) => { foreground: 'rgba(255,255,255,0.8)' }, cursorInactiveStyle: 'none', - smoothScrollDuration: 600 + smoothScrollDuration: 0 }); fitAddonRef.current = new FitAddon(); termRef.current.loadAddon(fitAddonRef.current); @@ -82,7 +76,7 @@ const LogsViewer: React.FC = (props) => { termRef.current.onWriteParsed((e: any) => { if (cacheDataRef.current) { - window.requestAnimationFrame(scrollAnimation); + termRef.current?.scrollToBottom(); } }); };