Skip to content

Commit

Permalink
Merge pull request #218 from keen/Bugfix/#206
Browse files Browse the repository at this point in the history
Fix for update access key
  • Loading branch information
dariuszlacheta authored Dec 9, 2019
2 parents 768d1aa + f56e4c5 commit d069ff3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/actions/rootActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export const selectSavedQuery = (queryNames, index) => (dispatch, getState) => {
const isPublic = dashboardInfo.is_public;
if (isPublic && savedQueries.length) {
const isNewQueryAdded = savedQueries.some(
query => !savedQueriesList.includes(query)
query => !savedQueriesList.includes(query.value)
);
if (isNewQueryAdded) {
updateAPIKey(newSavedQueriesList, dashboardInfo.title);
Expand Down Expand Up @@ -304,9 +304,15 @@ export const deleteChart = index => (dispatch, getState) => {
dispatch(changeSavedQueryList(delValue, []));
const newStore = getState();
const savedQueriesList = getSavedQueriesList(newStore);
delValue.some(sq => !savedQueriesList.includes(sq)) &&
dashboardInfo.is_public &&
updateAPIKey(savedQueriesList, dashboardInfo.title);
const isPublic = dashboardInfo.is_public;
if (isPublic && delValue.length) {
const isNewQueryAdded = delValue.some(
query => !savedQueriesList.includes(query.value)
);
if (isNewQueryAdded) {
updateAPIKey(savedQueriesList, dashboardInfo.title);
}
}
dispatch({
type: actions.DELETE_CHART,
index
Expand Down

0 comments on commit d069ff3

Please sign in to comment.