Do not uncessarily fetch locales at first time you open/save settings menu
Locales would be fetched even if you simply open and save settings window (without changing any setting) We now test it similarly we do on 2.2 Closes #11318
This commit is contained in:
parent
6c5a0de107
commit
d961dea594
@ -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