Skip to content

Commit ecddb43

Browse files
committed
frontend/chat: change a too large number to a MAX_SAFE_INTEGER
1 parent 4621688 commit ecddb43

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/packages/frontend/chat/chat-log.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,15 @@ export function ChatLog(props: Readonly<Props>) {
116116
scrollToBottomRef.current = (force?: boolean) => {
117117
if (manualScrollRef.current && !force) return;
118118
manualScrollRef.current = false;
119-
virtuosoRef.current?.scrollToIndex({ index: 99999999999999999999 });
119+
virtuosoRef.current?.scrollToIndex({ index: Number.MAX_SAFE_INTEGER });
120120
// sometimes scrolling to bottom is requested before last entry added,
121121
// so we do it again in the next render loop. This seems needed mainly
122122
// for side chat when there is little vertical space.
123123
setTimeout(
124124
() =>
125-
virtuosoRef.current?.scrollToIndex({ index: 99999999999999999999 }),
125+
virtuosoRef.current?.scrollToIndex({
126+
index: Number.MAX_SAFE_INTEGER,
127+
}),
126128
0,
127129
);
128130
};

0 commit comments

Comments
 (0)