Skip to content

Commit

Permalink
Merge pull request getredash#11 from wlach/fix-persisting-datasource-…
Browse files Browse the repository at this point in the history
…selection-choice

Fix persisting datasource selection choice
  • Loading branch information
justinclift committed May 18, 2023
2 parents 0e7fbde + 6f45ba7 commit 7b6c855
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/app/pages/queries/QuerySource.jsx
Expand Up @@ -134,9 +134,11 @@ function QuerySource(props) {
// choose data source id for new queries
if (dataSourcesLoaded && queryFlags.isNew) {
const firstDataSourceId = dataSources.length > 0 ? dataSources[0].id : null;
const selectedDataSourceId = parseInt(localStorage.getItem("lastSelectedDataSourceId")) || null;

handleDataSourceChange(
chooseDataSourceId(
[query.data_source_id, localStorage.getItem("lastSelectedDataSourceId"), firstDataSourceId],
[query.data_source_id, selectedDataSourceId, firstDataSourceId],
dataSources
)
);
Expand Down

0 comments on commit 7b6c855

Please sign in to comment.