Fix the query undefined comparison when threadId prop is not set by the navigation library (#7302)

This commit is contained in:
Elias Nahum
2023-04-21 12:27:51 -04:00
committed by GitHub
parent 784b05fe97
commit 58d1b02d3a
9 changed files with 51 additions and 25 deletions

View File

@@ -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();
}
};

View File

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