Fix taglines on `Home` (#1701)
authorAlec Armbruster <35377827+alectrocute@users.noreply.github.com>
Thu, 29 Jun 2023 14:38:35 +0000 (10:38 -0400)
committerGitHub <noreply@github.com>
Thu, 29 Jun 2023 14:38:35 +0000 (10:38 -0400)
* fix taglines on home

* fix error on admin panel

src/shared/components/home/home.tsx
src/shared/components/home/tagline-form.tsx

index 5ef1a87d672f50827856c315e444a49fdc804765..5e733674ac1fc9baee519409ebf0237419e39c0a 100644 (file)
@@ -279,13 +279,15 @@ export class Home extends Component<any, HomeState> {
         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() {
index bdbe1e63df87649f6e739d9ca8c71afca3d5d0ef..f7cf99a664098538266af62b06200828fc709046 100644 (file)
@@ -141,7 +141,7 @@ export class TaglineForm extends Component<TaglineFormProps, TaglineFormState> {
 
   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 });