Fix taglines on Home (#1701)

* fix taglines on home

* fix error on admin panel
This commit is contained in:
Alec Armbruster 2023-06-29 10:38:35 -04:00 committed by GitHub
parent 751495702c
commit 80d9aac1ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -279,13 +279,15 @@ export class Home extends Component<any, HomeState> {
trendingCommunitiesRes, trendingCommunitiesRes,
commentsRes, commentsRes,
postsRes, postsRes,
tagline: getRandomFromList(this.state?.siteRes?.taglines ?? [])
?.content,
isIsomorphic: true, isIsomorphic: true,
}; };
HomeCacheService.postsRes = postsRes; HomeCacheService.postsRes = postsRes;
} }
this.state.tagline = getRandomFromList(
this.state?.siteRes?.taglines ?? []
)?.content;
} }
componentWillUnmount() { componentWillUnmount() {

View file

@ -141,7 +141,7 @@ export class TaglineForm extends Component<TaglineFormProps, TaglineFormState> {
handleEditTaglineClick(d: { i: TaglineForm; index: number }, event: any) { handleEditTaglineClick(d: { i: TaglineForm; index: number }, event: any) {
event.preventDefault(); event.preventDefault();
if (this.state.editingRow == d.index) { if (d.i.state.editingRow == d.index) {
d.i.setState({ editingRow: undefined }); d.i.setState({ editingRow: undefined });
} else { } else {
d.i.setState({ editingRow: d.index }); d.i.setState({ editingRow: d.index });