Skip to content

Commit

Permalink
Merge pull request #2565 from Hyperkid123/safe-access-find
Browse files Browse the repository at this point in the history
Add safe accesor to chrome link href string.
  • Loading branch information
Hyperkid123 authored Jul 11, 2023
2 parents 8b94ab8 + 19101f7 commit 2ae8fad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/ChromeLink/ChromeLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface LinkWrapperProps extends RefreshLinkProps {
const LinkWrapper: React.FC<LinkWrapperProps> = memo(({ href, isBeta, onLinkClick, className, currAppId, appId, children, tabIndex }) => {
const linkRef = useRef<HTMLAnchorElement | null>(null);
const moduleRoutes = useSelector<ReduxState, RouteDefinition[]>(({ chrome: { moduleRoutes } }) => moduleRoutes);
const moduleEntry = useMemo(() => moduleRoutes.find((route) => href.includes(route.path)), [href, appId]);
const moduleEntry = useMemo(() => moduleRoutes.find((route) => href?.includes(route.path)), [href, appId]);
const preloadTimeout = useRef<NodeJS.Timeout>();
let actionId = href.split('/').slice(2).join('/');
if (actionId.includes('/')) {
Expand Down

0 comments on commit 2ae8fad

Please sign in to comment.