From 4bc06a120b1b8c56f6e7b24baf5d7af2590f17f5 Mon Sep 17 00:00:00 2001
From: nkdengineer <nkdengineer@outlook.com>
Date: Tue, 27 Aug 2024 10:36:06 +0700
Subject: [PATCH 1/3] fix: Not here page appears briefly after deleting the
 list value

---
 .../reportFields/ReportFieldsValueSettingsPage.tsx          | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/pages/workspace/reportFields/ReportFieldsValueSettingsPage.tsx b/src/pages/workspace/reportFields/ReportFieldsValueSettingsPage.tsx
index 977e64c882f1..2b636270771b 100644
--- a/src/pages/workspace/reportFields/ReportFieldsValueSettingsPage.tsx
+++ b/src/pages/workspace/reportFields/ReportFieldsValueSettingsPage.tsx
@@ -11,6 +11,7 @@ import ScreenWrapper from '@components/ScreenWrapper';
 import Switch from '@components/Switch';
 import Text from '@components/Text';
 import useLocalize from '@hooks/useLocalize';
+import usePrevious from '@hooks/usePrevious';
 import useThemeStyles from '@hooks/useThemeStyles';
 import * as ReportField from '@libs/actions/Policy/ReportField';
 import Navigation from '@libs/Navigation/Navigation';
@@ -58,18 +59,17 @@ function ReportFieldsValueSettingsPage({
     }, [formDraft?.disabledListValues, formDraft?.listValues, policy?.fieldList, reportFieldID, valueIndex]);
 
     const hasAccountingConnections = PolicyUtils.hasAccountingConnections(policy);
+    const oldValueName = usePrevious(currentValueName);
 
-    if (!currentValueName || hasAccountingConnections) {
+    if ((!currentValueName && !oldValueName) || hasAccountingConnections) {
         return <NotFoundPage />;
     }
-
     const deleteListValueAndHideModal = () => {
         if (reportFieldID) {
             ReportField.removeReportFieldListValue(policyID, reportFieldID, [valueIndex]);
         } else {
             ReportField.deleteReportFieldsListValue([valueIndex]);
         }
-
         setIsDeleteTagModalOpen(false);
         Navigation.goBack();
     };

From 7bde267707422e403eb159a0db36cc665ac7b881 Mon Sep 17 00:00:00 2001
From: nkdengineer <nkdengineer@outlook.com>
Date: Thu, 5 Sep 2024 10:54:54 +0700
Subject: [PATCH 2/3] fix: add fallback title

---
 .../workspace/reportFields/ReportFieldsValueSettingsPage.tsx    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pages/workspace/reportFields/ReportFieldsValueSettingsPage.tsx b/src/pages/workspace/reportFields/ReportFieldsValueSettingsPage.tsx
index 2b636270771b..78e957087100 100644
--- a/src/pages/workspace/reportFields/ReportFieldsValueSettingsPage.tsx
+++ b/src/pages/workspace/reportFields/ReportFieldsValueSettingsPage.tsx
@@ -125,7 +125,7 @@ function ReportFieldsValueSettingsPage({
                         </View>
                     </View>
                     <MenuItemWithTopDescription
-                        title={currentValueName}
+                        title={currentValueName ?? oldValueName}
                         description={translate('common.value')}
                         shouldShowRightIcon={!reportFieldID}
                         interactive={!reportFieldID}

From fdc745f506fe694e3e7cf4d5e5c2da6e293b4a95 Mon Sep 17 00:00:00 2001
From: nkdengineer <nkdengineer@outlook.com>
Date: Thu, 5 Sep 2024 11:22:25 +0700
Subject: [PATCH 3/3] fix: add fallback to header

---
 .../workspace/reportFields/ReportFieldsValueSettingsPage.tsx    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pages/workspace/reportFields/ReportFieldsValueSettingsPage.tsx b/src/pages/workspace/reportFields/ReportFieldsValueSettingsPage.tsx
index 78e957087100..1db5d2ff2c9f 100644
--- a/src/pages/workspace/reportFields/ReportFieldsValueSettingsPage.tsx
+++ b/src/pages/workspace/reportFields/ReportFieldsValueSettingsPage.tsx
@@ -99,7 +99,7 @@ function ReportFieldsValueSettingsPage({
                 testID={ReportFieldsValueSettingsPage.displayName}
             >
                 <HeaderWithBackButton
-                    title={currentValueName}
+                    title={currentValueName ?? oldValueName}
                     shouldSetModalVisibility={false}
                 />
                 <ConfirmModal
