From 330324721bce63971ca58e975d95aa19b000616e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sat, 26 Jun 2021 15:15:31 +0200 Subject: [PATCH] cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/features/about/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/soapbox/features/about/index.js b/app/soapbox/features/about/index.js index fcd400d64..369872219 100644 --- a/app/soapbox/features/about/index.js +++ b/app/soapbox/features/about/index.js @@ -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(); }