Ensure metadata is not null before registering datasources for automatic hot reloading

This commit is contained in:
Andrew Kingston 2023-11-09 11:07:32 +00:00
parent 6b7e410f0d
commit 223a82f717
1 changed files with 7 additions and 6 deletions

View File

@ -45,12 +45,13 @@
// Register any "refresh datasource" actions with a singleton store
// so we can easily refresh data at all levels for any datasource
if (type === ActionTypes.RefreshDatasource) {
const { dataSource } = metadata || {}
dataSourceStore.actions.registerDataSource(
dataSource,
instanceId,
callback
)
if (metadata?.dataSource) {
dataSourceStore.actions.registerDataSource(
metadata.dataSource,
instanceId,
callback
)
}
}
})
}