From 200ccf8e06b0b534e346213dbfd98f9669b89eaa Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Wed, 15 Dec 2021 00:19:47 +0100 Subject: [PATCH] Fix LogConsole re-requesting logs Turns out objects in the second argument to useEffect is compared by Object.is(), this means if the array containing the instances or slaves to show logs for get re-created during an update the LogConsole component would send a new request for the logs. Fix by converting the slave_ids and instance_ids arrays into strings before passing them on to useEffect. --- packages/web_ui/src/components/LogConsole.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web_ui/src/components/LogConsole.jsx b/packages/web_ui/src/components/LogConsole.jsx index a9fd58d7..60b90bea 100644 --- a/packages/web_ui/src/components/LogConsole.jsx +++ b/packages/web_ui/src/components/LogConsole.jsx @@ -94,7 +94,7 @@ export default function LogConsole(props) { return () => { control.offLog(logFilter, logHandler); }; - }, [props.all, props.master, props.slaves, props.instances]); + }, [props.all, props.master, (props.slaves || []).join(), (props.instances || []).join()]); return <>