mirror of
https://github.com/vrc-get/vrc-get.git
synced 2026-06-21 09:58:08 +00:00
chore: remove requestAnimationFrame()
This commit is contained in:
parent
4bd49c4fdf
commit
bfc030d5aa
1 changed files with 9 additions and 11 deletions
|
|
@ -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"];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue