console: avoid setting current datasource if imported metadata doesn't contain any source (close #7725)

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2735
GitOrigin-RevId: b1daf6a57fd148bb25bf292fa5f1efe671144df9
This commit is contained in:
Ikechukwu Eze 2021-11-02 13:46:13 +01:00 committed by hasura-bot
parent 7609ae84e1
commit 5694d41025

View File

@ -530,7 +530,7 @@ export const replaceMetadata = (
x.name === getState().tables.currentDataSource
);
if (!currentSource) {
if (!currentSource && newState.metadata.sources?.[0]) {
dispatch({
type: UPDATE_CURRENT_DATA_SOURCE,
source: newState.metadata.sources[0].name,