Skip to content

Commit

Permalink
Merge pull request #887 from neo4j-labs/fix/persist-params
Browse files Browse the repository at this point in the history
fixing string edge case at param loading
  • Loading branch information
mariusconjeaud authored May 13, 2024
2 parents e8b85bd + 546b6ae commit 0078f06
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/settings/SettingsThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export const updateGlobalParametersThunk = (newParameters) => (dispatch: any, ge
try {
const { settings } = getState().dashboard;
const parameters = settings.parameters ? settings.parameters : {};

// if new parameters are set...
if (newParameters) {
// iterate over the key value pairs in parameters
Expand Down Expand Up @@ -92,7 +91,11 @@ export const updateParametersToNeo4jTypeThunk = () => (dispatch: any, getState:
Object.keys(parameters).forEach((key) => {
if (isCastableToNeo4jDate(parameters[key])) {
parameters[key] = castToNeo4jDate(parameters[key]);
} else if (parameters[key] && typeof toNumber(parameters[key]) === 'number') {
} else if (
parameters[key] &&
!isNaN(toNumber(parameters[key])) &&
typeof toNumber(parameters[key]) === 'number'
) {
parameters[key] = toNumber(parameters[key]);
} else if (parameters[key] == undefined) {
delete parameters[key];
Expand Down

0 comments on commit 0078f06

Please sign in to comment.