From d5cfc7337ad530d2fd59a9bd278ee98e8db5069e Mon Sep 17 00:00:00 2001 From: SleeplessOne1917 <28871516+SleeplessOne1917@users.noreply.github.com> Date: Thu, 18 Apr 2024 19:49:09 -0400 Subject: [PATCH] Autoexpand --- src/shared/components/post/post-listing.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index c9c1b889..d5815dac 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -1,4 +1,4 @@ -import { myAuth } from "@utils/app"; +import { myAuth, setIsoData } from "@utils/app"; import { canShare, share } from "@utils/browser"; import { getExternalHost, getHttpBase } from "@utils/env"; import { futureDaysToUnixTime, hostname } from "@utils/helpers"; @@ -33,7 +33,7 @@ import { TransferCommunity, } from "lemmy-js-client"; import { relTags } from "../../config"; -import { VoteContentType } from "../../interfaces"; +import { IsoDataOptionalSite, VoteContentType } from "../../interfaces"; import { mdToHtml, mdToHtmlInline } from "../../markdown"; import { I18NextService, UserService } from "../../services"; import { tippyMixin } from "../mixins/tippy-mixin"; @@ -98,9 +98,10 @@ interface PostListingProps { @tippyMixin export class PostListing extends Component { + private readonly isoData: IsoDataOptionalSite = setIsoData(this.context); state: PostListingState = { showEdit: false, - imageExpanded: false, + imageExpanded: !!this.isoData.site_res?.site_view.site.content_warning, viewSource: false, showAdvanced: false, showBody: false,