Fix datasource renames being reverted when changing schema

This commit is contained in:
Andrew Kingston 2024-11-01 14:53:08 +00:00
parent 8c09ff830a
commit f9c98d8f90
No known key found for this signature in database
1 changed files with 9 additions and 0 deletions

View File

@ -61,6 +61,15 @@ export const createGridWebsocket = context => {
} }
} }
) )
socket.on(
GridSocketEvent.DatasourceChange,
({ datasource: newDatasource }) => {
// Listen builder renames, as these aren't handled otherwise
if (newDatasource?.name !== get(definition).name) {
definition.set(newDatasource)
}
}
)
// Change websocket connection when table changes // Change websocket connection when table changes
datasource.subscribe(connectToDatasource) datasource.subscribe(connectToDatasource)