Remote
@@ -304,9 +304,10 @@ export function Notebook({api, datasource, show, data}) {
}
useEffect(() => {
console.log('datasource', datasource)
- setState(Object.assign({}, data, {datasource_id: datasource?.datasource_id, cells: Object.fromEntries((data?.cells || []).map(cell => [cell.id, cell]))}))
+ setState(Object.assign({}, data, {datasource_id: datasource?.datasource_id || data?.datasource_id, cells: Object.fromEntries((data?.cells || []).map(cell => [cell.id, cell]))}))
}, [data, datasource])
console.log('state@Notebook', state)
+ console.log('data@notebook', data)
if(!show) return
return (
@@ -315,6 +316,7 @@ export function Notebook({api, datasource, show, data}) {
onPublish={() => {
api.userdata.notebooks.write(Object.assign({}, state, {cells: Object.values(state.cells)}))
}}
+ datasource={state.datasource_id}
/>
{Object.values(state.cells).map((cell, idx) =>