From c4730c3e4947128829cfbfacf36924edf98c2b9b Mon Sep 17 00:00:00 2001 From: Mateo Silguero Date: Tue, 10 Dec 2019 06:02:40 -0800 Subject: [PATCH] Parse all values on json fields (#678) Summary: I want to get a better visualisation of the databases values from a device, like the localStorage from ReactNative. ## Changelog Iterate on the object value to parse all values from a json Pull Request resolved: https://github.com/facebook/flipper/pull/678 Test Plan: before: Captura de Pantalla 2019-12-06 a la(s) 19 57 13 after: Captura de Pantalla 2019-12-06 a la(s) 19 55 52 Reviewed By: nikoant Differential Revision: D18874887 Pulled By: passy fbshipit-source-id: 679519fe2746a698e41ba015fd811a342c96c4fd --- src/plugins/databases/index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/plugins/databases/index.js b/src/plugins/databases/index.js index 87011107a..6b2bc5d87 100644 --- a/src/plugins/databases/index.js +++ b/src/plugins/databases/index.js @@ -1083,12 +1083,13 @@ export default class DatabasesPlugin extends FlipperPlugin< buildSidebarRow = (key: string, val: any) => { let output = ''; try { - output = ( - - ); + const parsed = JSON.parse(val.props.children); + for (const key in parsed) { + try { + parsed[key] = JSON.parse(parsed[key]); + } catch (err) {} + } + output = ; } catch (error) { output = val; }