From f7c254ef032505b0330546a18f84075ba321efdf Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 24 Jun 2021 12:57:18 -0400 Subject: [PATCH] MM-36532 navigate to channel from any screen when channel link is pressed (#5467) --- app/components/markdown/markdown_link/markdown_link.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/components/markdown/markdown_link/markdown_link.js b/app/components/markdown/markdown_link/markdown_link.js index 6ebcab015..200ab059e 100644 --- a/app/components/markdown/markdown_link/markdown_link.js +++ b/app/components/markdown/markdown_link/markdown_link.js @@ -8,6 +8,7 @@ import Clipboard from '@react-native-community/clipboard'; import {intlShape} from 'react-intl'; import urlParse from 'url-parse'; +import {dismissAllModals, popToRoot} from '@actions/navigation'; import Config from '@assets/config'; import {DeepLinkTypes} from '@constants'; import {getCurrentServerUrl} from '@init/credentials'; @@ -59,7 +60,9 @@ export default class MarkdownLink extends PureComponent { if (match) { if (match.type === DeepLinkTypes.CHANNEL) { - handleSelectChannelByName(match.channelName, match.teamName, errorBadChannel, intl); + await handleSelectChannelByName(match.channelName, match.teamName, errorBadChannel, intl); + await dismissAllModals(); + await popToRoot(); } else if (match.type === DeepLinkTypes.PERMALINK) { const teamName = match.teamName === PERMALINK_GENERIC_TEAM_NAME_REDIRECT ? currentTeamName : match.teamName; showPermalink(intl, teamName, match.postId);