Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check API settings values before storing them in the SettingsProvider #49

Open
wants to merge 1 commit into
base: current
Choose a base branch
from

Conversation

andreaforni
Copy link
Contributor

This PR closes #48.

It checks if the settings returned by the backend are undefined/null before setting them into the provider.

@andreaforni andreaforni self-assigned this Aug 27, 2020
@jasnell
Copy link
Contributor

jasnell commented Nov 17, 2020

Ping @covidgreen/members ... looks like this one needs review? It's been sitting here for a while

riskGroupMinAge: Number(apiSettings.riskGroupMinAge),
hsePhoneNumber: apiSettings.hsePhoneNumber
});
const appConfig: AppConfig = {...defaultValue.appConfig};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super minor, but as a guard against potential performance issues elsewhere, it would be good to still predefine these properties.

Suggested change
const appConfig: AppConfig = {...defaultValue.appConfig};
const appConfig: AppConfig = {
...defaultValue.appConfig,
checkInMaxAge: undefined,
riskGroupMinAge: undefined,
hsePhoneNumber: undefined
};

Same with the traceConfiguration below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix: check API settings values before storing them in the SettingsProvider
2 participants