From 93de5c086e8aa530b4becced7f1e1db2e8c2d5f9 Mon Sep 17 00:00:00 2001 From: Gaagul Gigi <70290286+gaagul@users.noreply.github.com> Date: Thu, 7 Dec 2023 13:18:58 +0530 Subject: [PATCH] Revert "Added conditions to check if image exists before adding event listeners (#957)" (#958) This reverts commit 374d1f4341340bfc79123c58b9b0a65fbc666eee. --- src/components/EditorContent/index.jsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/EditorContent/index.jsx b/src/components/EditorContent/index.jsx index 7f1dec46..3b1b9c92 100644 --- a/src/components/EditorContent/index.jsx +++ b/src/components/EditorContent/index.jsx @@ -3,7 +3,7 @@ import React, { useEffect, useRef, useState } from "react"; import classnames from "classnames"; import DOMPurify from "dompurify"; import CopyToClipboardButton from "neetomolecules/CopyToClipboardButton"; -import { isNil, not } from "ramda"; +import { not } from "ramda"; import { createRoot } from "react-dom/client"; import { EDITOR_CONTENT_CLASSNAME, SANITIZE_OPTIONS } from "./constants"; @@ -45,9 +45,10 @@ const EditorContent = ({ figureTags.forEach(figureTag => { const image = figureTag.querySelector("img"); const link = figureTag.querySelector("a"); - if (isNil(image) || isNil(link)) return; - - if (not(window.getComputedStyle(link).pointerEvents === "none")) { + if ( + !image || + not(window.getComputedStyle(link).pointerEvents === "none") + ) { return; } figureTag.style.cursor = "pointer";