chore: remove requestAnimationFrame()

This commit is contained in:
RingLo_ 2025-05-13 15:52:54 +08:00
commit bfc030d5aa

View file

@ -31,19 +31,17 @@ export const LogsListCard = memo(function LogsListCard({
useEffect(() => {
if (!autoScroll) return;
requestAnimationFrame(() => {
if (!scrollContainerRef.current) return;
if (!scrollContainerRef.current) return;
const container = scrollContainerRef.current;
const isNearBottom =
container.scrollHeight -
(container.scrollTop + container.clientHeight) <
50;
const container = scrollContainerRef.current;
const isNearBottom =
container.scrollHeight -
(container.scrollTop + container.clientHeight) <
50;
if (!isNearBottom) {
container.scrollTop = container.scrollHeight;
}
});
if (!isNearBottom) {
container.scrollTop = container.scrollHeight;
}
}, [logsShown, autoScroll]);
const TABLE_HEAD = ["logs:time", "logs:level", "logs:message"];