Merge pull request #11443 from mariogasparoni/develop
Do not uncessarily fetch locales at first time you open/save settings menu
This commit is contained in:
commit
fc001a142c
@ -55,9 +55,9 @@ class IntlStartup extends Component {
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
const { fetching, messages } = this.state;
|
||||
const { fetching, messages, normalizedLocale } = this.state;
|
||||
const { locale } = this.props;
|
||||
const shouldFetch = (!fetching && _.isEmpty(messages)) || (locale !== prevProps.locale);
|
||||
const shouldFetch = (!fetching && _.isEmpty(messages)) || ((locale !== prevProps.locale) && (normalizedLocale && (locale !== normalizedLocale)));
|
||||
if (shouldFetch) this.fetchLocalizedMessages(locale);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user