From 7337ae6f67489ddb40a68d96286ccaccc097eee0 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Tue, 14 Dec 2021 11:34:12 +0000 Subject: [PATCH] Flip datasource and baseDatsource to not update store directly --- .../datasource/[selectedDatasource]/index.svelte | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte index 87ff9691f8..dca4fd4a5b 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte @@ -23,20 +23,23 @@ import ImportRestQueriesModal from "components/backend/DatasourceNavigator/modals/ImportRestQueriesModal.svelte" let importQueriesModal - let baseDatasource, changed + let changed const querySchema = { name: {}, queryVerb: { displayName: "Method" }, } - $: datasource = $datasources.list.find(ds => ds._id === $datasources.selected) + $: baseDatasource = $datasources.list.find( + ds => ds._id === $datasources.selected + ) + $: datasource = cloneDeep(datasource) $: integration = datasource && $integrations[datasource.source] $: { if ( - datasource && - (!baseDatasource || baseDatasource.source !== datasource.source) + baseDatasource && + (!datasource || datasource.source !== baseDatasource.source) ) { - baseDatasource = cloneDeep(datasource) + datasource = cloneDeep(baseDatasource) } } $: queryList = $queries.list.filter( @@ -90,7 +93,7 @@ height="26" width="26" /> - {baseDatasource.name} + {datasource.name} {integration.description}