From 2c869f4f49a3b28e89305fe6726ad670c11b8e7e Mon Sep 17 00:00:00 2001 From: martinkrulltott Date: Wed, 3 Jan 2024 11:33:17 +0000 Subject: [PATCH] refactor: only dispatch addMetadata when there is something to add --- src/components/App.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/App.js b/src/components/App.js index 3281b35ca..ad8f5d169 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -360,8 +360,9 @@ const App = () => { } } } - - dispatch(acAddMetadata(optionSetsMetadata)) + if (Object.keys(optionSetsMetadata).length) { + dispatch(acAddMetadata(optionSetsMetadata)) + } } const addTrackedEntityTypeMetadata = (visualization) => {