Skip to content

Commit

Permalink
fix(cli-serve): used shared storage (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
miralemd committed Apr 3, 2020
1 parent 69f8478 commit b3d061c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion commands/serve/web/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export default function App({ app, info }) {
padding: 0,
}}
>
<Properties sn={sn} viz={activeViz} isTemp={!objectListMode} />
<Properties sn={sn} viz={activeViz} isTemp={!objectListMode} storage={storage} />
</Grid>
)}
</Grid>
Expand Down
11 changes: 2 additions & 9 deletions commands/serve/web/components/Properties.jsx
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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 => {
Expand Down

0 comments on commit b3d061c

Please sign in to comment.