Skip to content

Commit d6fc6d6

Browse files
authored
[UI] Fix logs loading #2892 (#2920)
* [UI] Fix logs loading #2892 * [UI] Fix logs loading #2892
1 parent cc77d48 commit d6fc6d6

File tree

1 file changed

+8
-2
lines changed
  • frontend/src/pages/Runs/Details/Logs

1 file changed

+8
-2
lines changed

frontend/src/pages/Runs/Details/Logs/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const Logs: React.FC<IProps> = ({ className, projectName, runName, jobSub
5656
const { clientHeight, scrollHeight } = codeRef.current;
5757

5858
if (scrollHeight - clientHeight <= LOADING_SCROLL_GAP) {
59-
getLogItems();
59+
getNextLogItems();
6060
}
6161
};
6262

@@ -79,7 +79,13 @@ export const Logs: React.FC<IProps> = ({ className, projectName, runName, jobSub
7979
.then((response) => {
8080
saveScrollPositionByBottom();
8181
const reversed = response.logs.toReversed();
82-
setLogsData((old) => [...reversed, ...old]);
82+
83+
if (nextToken) {
84+
setLogsData((old) => [...reversed, ...old]);
85+
} else {
86+
setLogsData(reversed);
87+
}
88+
8389
nextTokenRef.current = response.next_token;
8490
setIsLoading(false);
8591
})

0 commit comments

Comments
 (0)