diff --git a/packages/web/src/appobj/DatabaseObjectAppObject.js b/packages/web/src/appobj/DatabaseObjectAppObject.js index 7018478c6..e48039912 100644 --- a/packages/web/src/appobj/DatabaseObjectAppObject.js +++ b/packages/web/src/appobj/DatabaseObjectAppObject.js @@ -193,8 +193,10 @@ function Menu({ data }) { }, }, { - config: { chartType: 'bar' }, - sql: dmp.s, + editor: { + config: { chartType: 'bar' }, + sql: dmp.s, + }, } ); } else { diff --git a/packages/web/src/modals/FavoriteModal.js b/packages/web/src/modals/FavoriteModal.js index 391947fcc..27e5da54f 100644 --- a/packages/web/src/modals/FavoriteModal.js +++ b/packages/web/src/modals/FavoriteModal.js @@ -55,11 +55,11 @@ export default function FavoriteModal({ modalState, editingData = undefined, sav const skipEditor = !!savedFile && values.whatToSave != 'content'; const re = new RegExp(`tabdata_(.*)_${savingTab.tabid}`); - for (const key in await localforage.keys()) { + for (const key of await localforage.keys()) { const match = key.match(re); if (!match) continue; if (skipEditor && match[1] == 'editor') continue; - tabdata[match[1]] = JSON.parse(await localforage.getItem(key)); + tabdata[match[1]] = await localforage.getItem(key); } for (const key in localStorage) { const match = key.match(re); @@ -67,6 +67,7 @@ export default function FavoriteModal({ modalState, editingData = undefined, sav if (skipEditor && match[1] == 'editor') continue; tabdata[match[1]] = JSON.parse(localStorage.getItem(key)); } + console.log('tabdata', tabdata, skipEditor, savingTab.tabid); return { props: diff --git a/packages/web/src/tabs/ChartTab.js b/packages/web/src/tabs/ChartTab.js index 0cbc13381..3e6214e7d 100644 --- a/packages/web/src/tabs/ChartTab.js +++ b/packages/web/src/tabs/ChartTab.js @@ -75,4 +75,4 @@ export default function ChartTab({ tabVisible, toolbarPortalRef, conid, database ); } -ChartTab.allowAddToFavorites = (props) => props.savedFile; +ChartTab.allowAddToFavorites = (props) => true; diff --git a/packages/web/src/tabs/QueryTab.js b/packages/web/src/tabs/QueryTab.js index 76b3d9b1d..48f432fb6 100644 --- a/packages/web/src/tabs/QueryTab.js +++ b/packages/web/src/tabs/QueryTab.js @@ -177,4 +177,4 @@ export default function QueryTab({ tabid, conid, database, initialArgs, tabVisib ); } -QueryTab.allowAddToFavorites = (props) => props.savedFile; +QueryTab.allowAddToFavorites = (props) => true; diff --git a/packages/web/src/tabs/ShellTab.js b/packages/web/src/tabs/ShellTab.js index 275064f33..b0c8fa466 100644 --- a/packages/web/src/tabs/ShellTab.js +++ b/packages/web/src/tabs/ShellTab.js @@ -140,4 +140,4 @@ export default function ShellTab({ tabid, tabVisible, toolbarPortalRef, ...other ); } -ShellTab.allowAddToFavorites = (props) => props.savedFile; +ShellTab.allowAddToFavorites = (props) => true; diff --git a/packages/web/src/widgets/Toolbar.js b/packages/web/src/widgets/Toolbar.js index fb7a43b4c..a830cb12d 100644 --- a/packages/web/src/widgets/Toolbar.js +++ b/packages/web/src/widgets/Toolbar.js @@ -144,7 +144,6 @@ export default function ToolBar({ toolbarPortalRef }) { {!!currentTab && tabs[currentTab.tabComponent] && tabs[currentTab.tabComponent].allowAddToFavorites && - currentTab.props && tabs[currentTab.tabComponent].allowAddToFavorites(currentTab.props) && ( Share