mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
fix(ui): reduce rerender in pod log view (#22241)
Signed-off-by: linghaoSu <linghao.su@daocloud.io>
This commit is contained in:
parent
e3b333a860
commit
4202168c44
1 changed files with 8 additions and 2 deletions
|
|
@ -175,7 +175,11 @@ export const PodsLogsViewer = (props: PodLogsProps) => {
|
|||
}),
|
||||
retryWhen(errors => errors.pipe(delay(500)))
|
||||
)
|
||||
.subscribe(log => setLogs(previousLogs => previousLogs.concat(log)));
|
||||
.subscribe(log => {
|
||||
if (log.length) {
|
||||
setLogs(previousLogs => previousLogs.concat(log));
|
||||
}
|
||||
});
|
||||
|
||||
return () => logsSource.unsubscribe();
|
||||
}, [applicationName, applicationNamespace, namespace, podName, group, kind, name, containerName, tail, follow, sinceSeconds, filter, previous, matchCase]);
|
||||
|
|
@ -247,8 +251,10 @@ export const PodsLogsViewer = (props: PodLogsProps) => {
|
|||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
const preferenceLoader = React.useCallback(() => services.viewPreferences.getPreferences(), []);
|
||||
return (
|
||||
<DataLoader load={() => services.viewPreferences.getPreferences()}>
|
||||
<DataLoader load={preferenceLoader}>
|
||||
{(prefs: ViewPreferences) => {
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
|
|
|||
Loading…
Reference in a new issue