fix: login page flag icon preload (#1393)

This commit is contained in:
Chell
2022-12-11 04:22:58 +01:00
committed by GitHub
parent a51f0d7c08
commit ef836acfe9
3 changed files with 17 additions and 10 deletions

View File

@ -69,6 +69,12 @@ class LoginPage extends React.Component {
}
}
componentDidMount() {
Setting.Countries.forEach((country) => {
new Image().src = `${Setting.StaticBaseUrl}/flag-icons/${country.country}.svg`;
});
}
componentDidUpdate(prevProps, prevState, snapshot) {
if (this.state.application && !prevState.application) {
const defaultCaptchaProviderItems = this.getDefaultCaptchaProviderItems(this.state.application);