From b3d061c809adc74e9defbadd48340da435bcb2b8 Mon Sep 17 00:00:00 2001 From: Miralem Drek Date: Fri, 3 Apr 2020 17:24:02 +0200 Subject: [PATCH] fix(cli-serve): used shared storage (#396) --- commands/serve/web/components/App.jsx | 2 +- commands/serve/web/components/Properties.jsx | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/commands/serve/web/components/App.jsx b/commands/serve/web/components/App.jsx index 4133facb0..f61cabb4b 100644 --- a/commands/serve/web/components/App.jsx +++ b/commands/serve/web/components/App.jsx @@ -301,7 +301,7 @@ export default function App({ app, info }) { padding: 0, }} > - + )} diff --git a/commands/serve/web/components/Properties.jsx b/commands/serve/web/components/Properties.jsx index 1701cd071..3ae86c03b 100644 --- a/commands/serve/web/components/Properties.jsx +++ b/commands/serve/web/components/Properties.jsx @@ -1,4 +1,4 @@ -import React, { useCallback, useMemo, useState, useContext } from 'react'; +import React, { useCallback, useState } from 'react'; import { Divider, Grid, Checkbox, FormControlLabel } from '@material-ui/core'; @@ -7,16 +7,9 @@ import useProperties from '@nebula.js/nucleus/src/hooks/useProperties'; import Data from './property-panel/Data'; import generateComponents from './AutoComponents'; -import AppContext from '../contexts/AppContext'; - -import storageFn from '../storage'; - -export default function Properties({ viz, sn, isTemp }) { +export default function Properties({ viz, sn, isTemp, storage }) { const [properties] = useProperties(viz.model); - const app = useContext(AppContext); - const storage = useMemo(() => storageFn(app), [app]); - const [isReadCacheEnabled, setReadCacheEnabled] = useState(storage.get('readFromCache') !== false); const handleCacheChange = e => {