From: abias Date: Tue, 30 May 2023 00:41:54 +0000 (-0400) Subject: Merge branch 'main' into route-data-refactor X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%7Bthis.state.thumbnail%7D?a=commitdiff_plain;h=72b4d14b47dd8501597b15cc0cf5713ff86aaca9;p=lemmy-ui.git Merge branch 'main' into route-data-refactor --- 72b4d14b47dd8501597b15cc0cf5713ff86aaca9 diff --cc src/shared/components/post/create-post.tsx index f43cbb0,28418d1..684dda2 --- a/src/shared/components/post/create-post.tsx +++ b/src/shared/components/post/create-post.tsx @@@ -76,12 -70,14 +75,12 @@@ export class CreatePost extends Compone // Only fetch the data if coming from another route if (this.isoData.path === this.context.router.route.match.url) { - const communityRes = this.isoData.routeData[0] as - | GetCommunityResponse - | undefined; + const { communityResponse } = this.isoData.routeData; - if (communityRes) { + if (communityResponse) { const communityChoice: Choice = { - label: communityResponse.community_view.community.name, - label: communityRes.community_view.community.title, - value: communityRes.community_view.community.id.toString(), ++ label: communityResponse.community_view.community.title, + value: communityResponse.community_view.community.id.toString(), }; this.state = {