Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
actually-fix-tabs-bar
marcin mikołajczak 2021-06-26 15:15:31 +02:00
rodzic 5e7ed0826e
commit 330324721b
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -37,21 +37,21 @@ class AboutPage extends ImmutablePureComponent {
setLocale = (locale) => () => {
this.setState({ locale });
this.loadPageHtml();
};
componentDidMount() {
this.loadPageHtml();
}
componentDidUpdate(prevProps, prevState) {
componentDidUpdate(prevProps) {
const { locale, match, aboutPages } = this.props;
const { locale: prevLocale, aboutPages: prevAboutPages } = prevProps;
const { locale: stateLocale } = this.props;
const { locale: prevStateLocale } = prevState;
const { slug } = match.params;
const { slug: prevSlug } = prevProps.match.params;
if (locale !== prevLocale) this.setState({ locale });
if (slug !== prevSlug || stateLocale !== prevStateLocale || (!prevAboutPages.get(slug || 'about') && aboutPages.get(slug || 'about')))
if (slug !== prevSlug || (!prevAboutPages.get(slug || 'about') && aboutPages.get(slug || 'about')))
this.loadPageHtml();
}