From f6261611f06471259ac9eb1bf49471d54dcd9991 Mon Sep 17 00:00:00 2001 From: btzr-io Date: Tue, 20 Jul 2021 18:49:41 -0500 Subject: [PATCH] fix ClaimPreview errors --- ui/component/claimPreview/view.jsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ui/component/claimPreview/view.jsx b/ui/component/claimPreview/view.jsx index 1694bbe24..a1b050c56 100644 --- a/ui/component/claimPreview/view.jsx +++ b/ui/component/claimPreview/view.jsx @@ -180,7 +180,17 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { const isCollection = claim && claim.value_type === 'collection'; const isChannelUri = isValid ? parseURI(uri).isChannel : false; const signingChannel = claim && claim.signing_channel; - const channelTitle = signingChannel && (signingChannel.value.title || signingChannel.name); + + // Get channel title ( use name as fallback ) + let channelTitle = null; + if (signingChannel) { + const { value, name } = signingChannel; + if (value && value.title) { + channelTitle = value.title; + } else { + channelTitle = name; + } + } // Aria-label value for claim preview let ariaLabelData = title; @@ -375,7 +385,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { {pending ? ( ) : ( - + )}