From a58726ed0c541e09abadbbd17d138cb7f616936e Mon Sep 17 00:00:00 2001 From: Yauheni Date: Wed, 28 Feb 2024 17:54:32 +0100 Subject: [PATCH 1/2] Fix bug with Navigating back from the Room Description page opens the Room Settings page --- src/pages/RoomDescriptionPage.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/RoomDescriptionPage.tsx b/src/pages/RoomDescriptionPage.tsx index 6300b8c4cdce..a57d2a6ff4e6 100644 --- a/src/pages/RoomDescriptionPage.tsx +++ b/src/pages/RoomDescriptionPage.tsx @@ -19,7 +19,6 @@ import updateMultilineInputRange from '@libs/updateMultilineInputRange'; import * as Report from '@userActions/Report'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; import INPUT_IDS from '@src/types/form/ReportDescriptionForm'; import type * as OnyxTypes from '@src/types/onyx'; @@ -71,7 +70,7 @@ function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) { Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID))} + onBackButtonPress={() => Navigation.goBack()} /> Date: Wed, 28 Feb 2024 18:16:24 +0100 Subject: [PATCH 2/2] Refactor code --- src/pages/RoomDescriptionPage.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/pages/RoomDescriptionPage.tsx b/src/pages/RoomDescriptionPage.tsx index a57d2a6ff4e6..9d26de1da9f1 100644 --- a/src/pages/RoomDescriptionPage.tsx +++ b/src/pages/RoomDescriptionPage.tsx @@ -13,7 +13,6 @@ import TextInput from '@components/TextInput'; import type {BaseTextInputRef} from '@components/TextInput/BaseTextInput/types'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; -import Navigation from '@libs/Navigation/Navigation'; import * as ReportUtils from '@libs/ReportUtils'; import updateMultilineInputRange from '@libs/updateMultilineInputRange'; import * as Report from '@userActions/Report'; @@ -68,10 +67,7 @@ function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) { testID={RoomDescriptionPage.displayName} > - Navigation.goBack()} - /> +