diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx
index db3c785f..6459a9de 100644
--- a/src/shared/components/post/post-listing.tsx
+++ b/src/shared/components/post/post-listing.tsx
@@ -33,6 +33,7 @@ import {
Language,
LockPost,
MarkPostAsRead,
+ MyUserInfo,
PersonView,
PostView,
PurgePerson,
@@ -49,7 +50,7 @@ import {
VoteContentType,
} from "../../interfaces";
import { mdToHtml, mdToHtmlInline } from "../../markdown";
-import { I18NextService, UserService } from "../../services";
+import { I18NextService } from "../../services";
import { setupTippy } from "../../tippy";
import { Icon, PurgeWarning, Spinner } from "../common/icon";
import { MomentTime } from "../common/moment-time";
@@ -98,6 +99,7 @@ interface PostListingState {
interface PostListingProps {
post_view: PostView;
+ myUserInfo?: MyUserInfo;
crossPosts?: PostView[];
moderators?: CommunityModeratorView[];
admins?: PersonView[];
@@ -171,11 +173,10 @@ export class PostListing extends Component
{
}
componentDidMount(): void {
- if (UserService.Instance.myUserInfo) {
+ if (this.props.myUserInfo) {
this.setState({
imageExpanded:
- UserService.Instance.myUserInfo.local_user_view.local_user
- .auto_expand,
+ this.props.myUserInfo.local_user_view.local_user.auto_expand,
});
}
}
@@ -629,6 +630,7 @@ export class PostListing extends Component {
{mobile && !this.props.viewOnly && (
{
{this.props.showBody && pv.post.body && this.viewSourceButton}
- {UserService.Instance.myUserInfo &&
- !this.props.viewOnly &&
- this.postActions()}
+ {this.props.myUserInfo && !this.props.viewOnly && this.postActions()}
);
}
@@ -687,7 +687,8 @@ export class PostListing extends Component