Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix go back from details page remove the linked report action #42239

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/pages/FlagCommentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import * as ReportUtils from '@libs/ReportUtils';
import * as Report from '@userActions/Report';
import * as Session from '@userActions/Session';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
import type SCREENS from '@src/SCREENS';
import type * as OnyxTypes from '@src/types/onyx';
import withReportAndReportActionOrNotFound from './home/report/withReportAndReportActionOrNotFound';
Expand Down Expand Up @@ -160,14 +159,7 @@ function FlagCommentPage({parentReportAction, route, report, parentReport, repor
>
{({safeAreaPaddingBottomStyle}) => (
<FullPageNotFoundView shouldShow={!ReportUtils.shouldShowFlagComment(getActionToFlag(), report)}>
<HeaderWithBackButton
title={translate('reportActionContextMenu.flagAsOffensive')}
shouldNavigateToTopMostReport
onBackButtonPress={() => {
Navigation.goBack();
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report?.reportID ?? ''));
}}
/>
<HeaderWithBackButton title={translate('reportActionContextMenu.flagAsOffensive')} />
<ScrollView
contentContainerStyle={safeAreaPaddingBottomStyle}
style={styles.settingsPageBackground}
Expand Down
8 changes: 1 addition & 7 deletions src/pages/ReportDetailsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {useRoute} from '@react-navigation/native';
import type {StackScreenProps} from '@react-navigation/stack';
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {View} from 'react-native';
Expand Down Expand Up @@ -66,7 +65,6 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
const {translate} = useLocalize();
const {isOffline} = useNetwork();
const styles = useThemeStyles();
const route = useRoute();
const [isLastMemberLeavingGroupModalVisible, setIsLastMemberLeavingGroupModalVisible] = useState(false);
const policy = useMemo(() => policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID ?? ''}`], [policies, report?.policyID]);
const isPolicyAdmin = useMemo(() => PolicyUtils.isPolicyAdmin(policy ?? null), [policy]);
Expand Down Expand Up @@ -312,11 +310,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD
return (
<ScreenWrapper testID={ReportDetailsPage.displayName}>
<FullPageNotFoundView shouldShow={isEmptyObject(report)}>
<HeaderWithBackButton
title={translate('common.details')}
onBackButtonPress={Navigation.goBack}
shouldNavigateToTopMostReport={!(route.params && 'backTo' in route.params)}
/>
<HeaderWithBackButton title={translate('common.details')} />
<ScrollView style={[styles.flex1]}>
<View style={styles.reportDetailsTitleContainer}>
{renderedAvatar}
Expand Down
Loading