Regression: Markdown handlePress not working properly (#3278)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Gerzon Z 2021-07-15 10:39:44 -04:00 committed by GitHub
parent d1702aa416
commit d1f35bb799
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -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;