Skip to content

Commit b85a4e5

Browse files
fix: External links and links to telemetry broken (#4293)
* jsonata added to dependecy array. Makehref corrected * Correction because of too many rerenders
1 parent 30a01ad commit b85a4e5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/Extensibility/components/ExternalLink.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import { Button, Icon, Link } from '@ui5/webcomponents-react';
1010
import { isNil } from 'lodash';
1111

1212
const makeHref = ({ linkObject, value }) => {
13-
if (linkObject?.linkError) return linkObject?.linkError?.message;
13+
const [link, linkError] = linkObject;
14+
if (linkError) return linkError;
1415

1516
let href;
1617
if (typeof value === 'string') {
@@ -19,8 +20,7 @@ const makeHref = ({ linkObject, value }) => {
1920
? value
2021
: `https://${value}`;
2122
}
22-
23-
return linkObject?.link || href;
23+
return link || href;
2424
};
2525

2626
export const ExternalLink = ({

src/sidebar/NavItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function NavItem({ node, subItem = false }: NavItemProps) {
5252
setJsonataError(error);
5353
});
5454
// eslint-disable-next-line react-hooks/exhaustive-deps
55-
}, [node.externalUrl, emptyResource]);
55+
}, [node.externalUrl, emptyResource, jsonata]);
5656

5757
const isSelected = useMemo(() => {
5858
if (node.externalUrl) return false;

0 commit comments

Comments
 (0)