From 87be1e4ff62f63262538815864c15dc16766f324 Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 17 Mar 2022 14:03:32 -0400 Subject: [PATCH] Remove other listener --- src/components/nitropedia/NitropediaView.tsx | 23 -------------------- 1 file changed, 23 deletions(-) diff --git a/src/components/nitropedia/NitropediaView.tsx b/src/components/nitropedia/NitropediaView.tsx index 948c0e25..ff94d717 100644 --- a/src/components/nitropedia/NitropediaView.tsx +++ b/src/components/nitropedia/NitropediaView.tsx @@ -1,4 +1,3 @@ -import { MouseEventType } from '@nitrots/nitro-renderer'; import { FC, useCallback, useEffect, useRef, useState } from 'react'; import { AddEventLinkTracker, GetConfiguration, NotificationUtilities, RemoveLinkEventTracker } from '../../api'; import { Base, NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../common'; @@ -29,17 +28,6 @@ export const NitropediaView: FC<{}> = props => }); }, []); - const onClick = useCallback((event: MouseEvent) => - { - if(!(event.target instanceof HTMLAnchorElement)) return; - - event.preventDefault(); - - const link = event.target.href; - - NotificationUtilities.openUrl(link); - }, []); - const onLinkReceived = useCallback((link: string) => { const value = link.split('/'); @@ -60,17 +48,6 @@ export const NitropediaView: FC<{}> = props => return () => RemoveLinkEventTracker(linkTracker); }, [ onLinkReceived ]); - useEffect(() => - { - const element = elementRef.current; - - if(!element) return; - - element.addEventListener(MouseEventType.MOUSE_CLICK, onClick); - - return () => element.removeEventListener(MouseEventType.MOUSE_CLICK, onClick); - }, [ onClick, content ]); - useEffect(() => { const handle = (event: MouseEvent) =>