Skip to content

Commit

Permalink
Regression: Markdown handlePress not working properly (#3278)
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Mello <diegolmello@gmail.com>
  • Loading branch information
gerzonc and diegolmello authored Jul 15, 2021
1 parent d1702aa commit d1f35bb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/containers/markdown/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d1f35bb

Please sign in to comment.