From f9c98d8f908bbd05321456d06c82b402bfc63c61 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 1 Nov 2024 14:53:08 +0000 Subject: [PATCH] Fix datasource renames being reverted when changing schema --- .../frontend-core/src/components/grid/lib/websocket.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/frontend-core/src/components/grid/lib/websocket.js b/packages/frontend-core/src/components/grid/lib/websocket.js index b0fd236989..e7b89ff58a 100644 --- a/packages/frontend-core/src/components/grid/lib/websocket.js +++ b/packages/frontend-core/src/components/grid/lib/websocket.js @@ -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 datasource.subscribe(connectToDatasource)