From e1462bc77ce5d553e30ad101bd5217be8d6947b0 Mon Sep 17 00:00:00 2001 From: James Acklin Date: Wed, 28 Apr 2021 21:04:43 -0400 Subject: [PATCH] messages: fixes mystery hamburger bouncing --- .../landscape/components/ResourceSkeleton.tsx | 58 +++++++++---------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/pkg/interface/src/views/landscape/components/ResourceSkeleton.tsx b/pkg/interface/src/views/landscape/components/ResourceSkeleton.tsx index dc4c8cae9..31af29920 100644 --- a/pkg/interface/src/views/landscape/components/ResourceSkeleton.tsx +++ b/pkg/interface/src/views/landscape/components/ResourceSkeleton.tsx @@ -122,36 +122,32 @@ export function ResourceSkeleton(props: ResourceSkeletonProps): ReactElement { ); const ExtraControls = () => { - if (workspace === '/messages') { - const resourceArr = association.resource.split('/'); - const resourceName = resourceArr[resourceArr.length - 1]; - if (!resourceName.startsWith('dm-')) { - return ( - - - - } - > - - + Add Ship - - - ); - } + if (workspace === '/messages' && !resource.startsWith('dm-')) { + return ( + + + + } + > + + + Add Ship + + + ); } if (canWrite) { return ( @@ -173,7 +169,7 @@ export function ResourceSkeleton(props: ResourceSkeletonProps): ReactElement { const actionsRef = useCallback((actionsRef) => { setActionsWidth(actionsRef?.getBoundingClientRect().width); - }, []); + }, [rid]); return (