}
async componentDidMount() {
- if (!this.state.isIsomorphic) {
+ if (!this.state.isIsomorphic || !this.isoData.routeData.length) {
await Promise.all([this.fetchTrendingCommunities(), this.fetchData()]);
}
+
setupTippy();
}
}
trendingCommunities(isMobile = false) {
- switch (this.state.trendingCommunitiesRes.state) {
+ switch (this.state.trendingCommunitiesRes?.state) {
case "loading":
return (
<h5>
const siteRes = this.state.siteRes;
if (dataType === DataType.Post) {
- switch (this.state.postsRes.state) {
+ switch (this.state.postsRes?.state) {
case "loading":
return (
<h5>
UserService.Instance.myUserInfo = site.data.my_user;
}
- i.props.history.replace("/");
+ i.props.history.action === "PUSH"
+ ? i.props.history.back()
+ : i.props.history.push("/");
break;
}