forked from Ivasoft/mattermost-mobile
Fix the query undefined comparison when threadId prop is not set by the navigation library (#7302)
This commit is contained in:
@@ -12,7 +12,7 @@ import SlideUpPanelItem from '@components/slide_up_panel_item';
|
||||
import {General} from '@constants';
|
||||
import {useServerUrl} from '@context/server';
|
||||
import {useIsTablet} from '@hooks/device';
|
||||
import {dismissAllModals, dismissBottomSheet, popToRoot} from '@screens/navigation';
|
||||
import {dismissAllModalsAndPopToRoot, dismissBottomSheet} from '@screens/navigation';
|
||||
|
||||
type Props = {
|
||||
isOptionItem?: boolean;
|
||||
@@ -31,8 +31,7 @@ const LeaveChannelLabel = ({canLeave, channelId, displayName, isOptionItem, type
|
||||
const close = async () => {
|
||||
await dismissBottomSheet();
|
||||
if (!isTablet) {
|
||||
await dismissAllModals();
|
||||
popToRoot();
|
||||
await dismissAllModalsAndPopToRoot();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import React from 'react';
|
||||
import {DeviceEventEmitter, type StyleProp, Text, type TextStyle} from 'react-native';
|
||||
|
||||
import {Navigation, Screens} from '@constants';
|
||||
import {popToRoot, dismissAllModals} from '@screens/navigation';
|
||||
import {dismissAllModalsAndPopToRoot} from '@screens/navigation';
|
||||
|
||||
type HashtagProps = {
|
||||
hashtag: string;
|
||||
@@ -15,8 +15,7 @@ type HashtagProps = {
|
||||
const Hashtag = ({hashtag, linkStyle}: HashtagProps) => {
|
||||
const handlePress = async () => {
|
||||
// Close thread view, permalink view, etc
|
||||
await dismissAllModals();
|
||||
await popToRoot();
|
||||
await dismissAllModalsAndPopToRoot();
|
||||
|
||||
DeviceEventEmitter.emit(Navigation.NAVIGATE_TO_TAB, {
|
||||
screen: Screens.SEARCH,
|
||||
|
||||
Reference in New Issue
Block a user