From 2c6c7fb46c2c0c7e7e05b212cfbba01cbe3fd998 Mon Sep 17 00:00:00 2001 From: Evgen Filatov Date: Thu, 22 Oct 2020 01:40:29 -0700 Subject: [PATCH] (flux stores) 5. make "logs" tab look nicer Summary: This diff implement few things: * Logs tab for plugin * Sending new state for each action is expensive, that is why flipper side receive only diffs and uses `getStateFromLogItem` to calculate new state * fixed `keys` in `DataInspector.tsx` which caused `DataInspector` become unresponsive {F340648998} Differential Revision: D23021619 fbshipit-source-id: 17490c25f7b86faf9e574a612996563aac18525e --- .../ui/components/data-inspector/DataInspector.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/desktop/app/src/ui/components/data-inspector/DataInspector.tsx b/desktop/app/src/ui/components/data-inspector/DataInspector.tsx index b2c6c5bcc..cc31d201c 100644 --- a/desktop/app/src/ui/components/data-inspector/DataInspector.tsx +++ b/desktop/app/src/ui/components/data-inspector/DataInspector.tsx @@ -487,7 +487,8 @@ const DataInspector: React.FC = memo( for (const key of keys) { const diffMetadataArr = diffMetadataExtractor(value, key, diffValue); - for (const metadata of diffMetadataArr) { + for (const [index, metadata] of diffMetadataArr.entries()) { + const metaKey = key + index; const dataInspectorNode = ( = memo( onRenderDescription={onRenderDescription} parentPath={path} depth={depth + 1} - key={key} + key={metaKey} name={key} data={metadata.data} diff={metadata.diff} @@ -511,11 +512,13 @@ const DataInspector: React.FC = memo( switch (metadata.status) { case 'added': - propertyNodes.push({dataInspectorNode}); + propertyNodes.push( + {dataInspectorNode}, + ); break; case 'removed': propertyNodes.push( - {dataInspectorNode}, + {dataInspectorNode}, ); break; default: