diff --git a/package.json b/package.json index 2bfafc2e3..d5dbaed9a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "harperdb-studio", - "version": "4.8.19", + "version": "4.8.20", "description": "A UI for HarperDB", "deploymentUrl": "studio.harperdb.io", "private": true, diff --git a/src/components/instance/browse/BrowseDatatable.js b/src/components/instance/browse/BrowseDatatable.js index ea6cee0e8..0565f72da 100644 --- a/src/components/instance/browse/BrowseDatatable.js +++ b/src/components/instance/browse/BrowseDatatable.js @@ -82,7 +82,7 @@ function BrowseDatatable({ tableState, setTableState, activeTable }) { filtered: tableState.filtered, pageSize: parseInt(tableState.pageSize, 10), sorted: tableState.sorted, - onlyCached: persistedUser?.onlyCached?.[activeTable], + onlyCached: tableState.onlyCached, page: tableState.page, auth, url, @@ -136,15 +136,13 @@ function BrowseDatatable({ tableState, setTableState, activeTable }) { tableState.page, tableState.filtered, tableState.pageSize, - persistedUser.onlyCached, + tableState.onlyCached, lastUpdate, activeTable, ]); const toggleOnlyCached = () => { - const onlyCached = typeof persistedUser.onlyCached === 'object' ? { ...persistedUser.onlyCached } : {}; - onlyCached[activeTable] = !persistedUser?.onlyCached?.[activeTable]; - setPersistedUser({ ...persistedUser, onlyCached }); + setTableState({ ...tableState, onlyCached: !tableState.onlyCached }); }; useInterval(() => tableState.autoRefresh && setLastUpdate(Date.now()), config.refresh_content_interval); @@ -156,7 +154,7 @@ function BrowseDatatable({ tableState, setTableState, activeTable }) { loading={loading} loadingFilter={loadingFilter} autoRefresh={tableState.autoRefresh} - onlyCached={persistedUser?.onlyCached?.[activeTable]} + onlyCached={tableState.onlyCached} refresh={() => { clearTableDescriptionCache(); setLastUpdate(Date.now()); diff --git a/src/components/instance/browse/index.js b/src/components/instance/browse/index.js index 002bc1b07..22420c1e0 100644 --- a/src/components/instance/browse/index.js +++ b/src/components/instance/browse/index.js @@ -31,6 +31,7 @@ const defaultTableState = { showFilter: false, newEntityAttributes: false, hashAttribute: false, + onlyCached: true, }; function NoPrimaryKeyMessage({ table }) {