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.
This commit is contained in:
Hornwitser committed 2021-12-15 00:19:47 +01:00
1 parent 285d71e13d
commit 200ccf8e06
1 file changed
+1 -1
@@ -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 <>
<Paragraph code className="instance-console">