From 80d9aac1cae64753117862143e256e4741b68d4d Mon Sep 17 00:00:00 2001 From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Thu, 29 Jun 2023 10:38:35 -0400 Subject: [PATCH] Fix taglines on `Home` (#1701) * fix taglines on home * fix error on admin panel --- src/shared/components/home/home.tsx | 6 ++++-- src/shared/components/home/tagline-form.tsx | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index 5ef1a87..5e73367 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -279,13 +279,15 @@ export class Home extends Component { trendingCommunitiesRes, commentsRes, postsRes, - tagline: getRandomFromList(this.state?.siteRes?.taglines ?? []) - ?.content, isIsomorphic: true, }; HomeCacheService.postsRes = postsRes; } + + this.state.tagline = getRandomFromList( + this.state?.siteRes?.taglines ?? [] + )?.content; } componentWillUnmount() { diff --git a/src/shared/components/home/tagline-form.tsx b/src/shared/components/home/tagline-form.tsx index bdbe1e6..f7cf99a 100644 --- a/src/shared/components/home/tagline-form.tsx +++ b/src/shared/components/home/tagline-form.tsx @@ -141,7 +141,7 @@ export class TaglineForm extends Component { handleEditTaglineClick(d: { i: TaglineForm; index: number }, event: any) { event.preventDefault(); - if (this.state.editingRow == d.index) { + if (d.i.state.editingRow == d.index) { d.i.setState({ editingRow: undefined }); } else { d.i.setState({ editingRow: d.index }); -- 2.44.1