From de8e8019645291cd41eaf19028455884dab4e1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20Erg=C3=BCl?= Date: Tue, 22 Aug 2023 14:15:09 +0300 Subject: [PATCH] fix "New post" button appears without login with actor --- apps/kampus/app/pano/PanoFeed.tsx | 5 +++++ .../kampus/app/pano/__generated__/PanoFeed_viewer.graphql.ts | 3 +++ 2 files changed, 8 insertions(+) diff --git a/apps/kampus/app/pano/PanoFeed.tsx b/apps/kampus/app/pano/PanoFeed.tsx index fdfaf347..fb8faf60 100644 --- a/apps/kampus/app/pano/PanoFeed.tsx +++ b/apps/kampus/app/pano/PanoFeed.tsx @@ -35,6 +35,9 @@ const fragment = graphql` const viewerFragment = graphql` fragment PanoFeed_viewer on Viewer { ...PostItem_viewer + actor { + displayName + } } `; @@ -49,6 +52,8 @@ export function PanoFeed(props: Props) { props.panoFeed ); const viewer = useFragment(viewerFragment, props.panoViewer); + // I get undefined here. + console.log(viewer?.actor); const feed = data.panoFeed; diff --git a/apps/kampus/app/pano/__generated__/PanoFeed_viewer.graphql.ts b/apps/kampus/app/pano/__generated__/PanoFeed_viewer.graphql.ts index a1aeb7a0..ae9feeef 100644 --- a/apps/kampus/app/pano/__generated__/PanoFeed_viewer.graphql.ts +++ b/apps/kampus/app/pano/__generated__/PanoFeed_viewer.graphql.ts @@ -11,6 +11,9 @@ import { Fragment, ReaderFragment } from 'relay-runtime'; import { FragmentRefs } from "relay-runtime"; export type PanoFeed_viewer$data = { + readonly actor: { + readonly displayName: string | null; + } | null; readonly " $fragmentSpreads": FragmentRefs<"PostItem_viewer">; readonly " $fragmentType": "PanoFeed_viewer"; };