Skip to content

Commit

Permalink
Fix taglines on Home (#1701)
Browse files Browse the repository at this point in the history
* fix taglines on home

* fix error on admin panel
  • Loading branch information
alectrocute committed Jun 29, 2023
1 parent 7514957 commit 80d9aac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/shared/components/home/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/home/tagline-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit 80d9aac

Please sign in to comment.