From d1f35bb79988aa95264961b171ad4943bdca3332 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Thu, 15 Jul 2021 10:39:44 -0400 Subject: [PATCH] Regression: Markdown handlePress not working properly (#3278) Co-authored-by: Diego Mello --- app/containers/markdown/Link.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/containers/markdown/Link.js b/app/containers/markdown/Link.js index 008dc0ba..615b6612 100644 --- a/app/containers/markdown/Link.js +++ b/app/containers/markdown/Link.js @@ -7,15 +7,19 @@ import { themes } from '../../constants/colors'; import { LISTENER } from '../Toast'; import EventEmitter from '../../utils/events'; import I18n from '../../i18n'; +import openLink from '../../utils/openLink'; const Link = React.memo(({ children, link, theme, onLinkPress }) => { const handlePress = () => { - if (!link || !onLinkPress) { + if (!link) { return; } - onLinkPress(link); + if (onLinkPress) { + return onLinkPress(link); + } + openLink(link, theme); }; const childLength = React.Children.toArray(children).filter(o => o).length;