From 197e9112bdea52eb00d0e999b7b283ea7eae1d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Doreau?= Date: Wed, 21 Jul 2021 00:02:06 +0200 Subject: [PATCH] fix(techdocs): entity not found MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémi Doreau --- .../techdocs/src/reader/components/TechDocsPage.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/techdocs/src/reader/components/TechDocsPage.tsx b/plugins/techdocs/src/reader/components/TechDocsPage.tsx index da5ade95f6..4675143341 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPage.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPage.tsx @@ -39,7 +39,10 @@ export const TechDocsPage = () => { return Promise.resolve(undefined); }, [kind, namespace, name, techdocsApi, documentReady]); - const { value: entityMetadataValue } = useAsync(() => { + const { + value: entityMetadataValue, + error: entityMetadataError, + } = useAsync(() => { return techdocsApi.getEntityMetadata({ kind, namespace, name }); }, [kind, namespace, name, techdocsApi]); @@ -47,10 +50,8 @@ export const TechDocsPage = () => { setDocumentReady(true); }, [setDocumentReady]); - if (entityMetadataRequest?.error) { - return ( - - ); + if (entityMetadataError) { + return ; } return (