From 8d1381e370ca567618b3989d1cd0e04e7ad1e14a Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 18 Mar 2026 16:12:54 +0800 Subject: [PATCH] remove unused alertMessage --- src/libs/actions/Policy/Policy.ts | 10 ---------- src/pages/workspace/WorkspaceInvitePage.tsx | 8 ++------ src/types/onyx/Policy.ts | 3 --- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index b462506f03a3c..0ca9b177ed2f6 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -2062,14 +2062,6 @@ function updateWorkspaceClientID(policyID: string, clientID: string, currentClie }); } -function hideWorkspaceAlertMessage(policyID: string) { - if (!deprecatedAllPolicies?.[policyID]) { - return; - } - - Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {alertMessage: ''}); -} - function updateAddress(policyID: string, newAddress: CompanyAddress) { const parameters: UpdatePolicyAddressParams = { policyID, @@ -3865,7 +3857,6 @@ function setWorkspaceInviteMessageDraft(policyID: string, message: string | null function clearErrors(policyID: string) { Onyx.merge(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, {errors: null}); - hideWorkspaceAlertMessage(policyID); } /** @@ -7084,7 +7075,6 @@ export { leaveWorkspace, addBillingCardAndRequestPolicyOwnerChange, hasActiveChatEnabledPolicies, - hideWorkspaceAlertMessage, deleteWorkspace, updateAddress, updateLastAccessedWorkspace, diff --git a/src/pages/workspace/WorkspaceInvitePage.tsx b/src/pages/workspace/WorkspaceInvitePage.tsx index f2462a634a5f9..ba8e313c52b5d 100644 --- a/src/pages/workspace/WorkspaceInvitePage.tsx +++ b/src/pages/workspace/WorkspaceInvitePage.tsx @@ -178,10 +178,7 @@ function WorkspaceInvitePage({route, policy}: WorkspaceInvitePageProps) { Navigation.navigate(ROUTES.WORKSPACE_INVITE_MESSAGE.getRoute(route.params.policyID, Navigation.getActiveRoute())); }, [route.params.policyID, selectedOptions]); - const [policyName, shouldShowAlertPrompt] = useMemo( - () => [policy?.name ?? '', !isEmptyObject(policy?.errors) || !!policy?.alertMessage], - [policy?.name, policy?.errors, policy?.alertMessage], - ); + const [policyName, shouldShowAlertPrompt] = useMemo(() => [policy?.name ?? '', !isEmptyObject(policy?.errors)], [policy?.name, policy?.errors]); const headerMessage = useMemo(() => { const searchValue = debouncedSearchTerm.trim().toLowerCase(); @@ -214,12 +211,11 @@ function WorkspaceInvitePage({route, policy}: WorkspaceInvitePageProps) { isAlertVisible={shouldShowAlertPrompt} buttonText={translate('common.next')} onSubmit={inviteUser} - message={policy?.alertMessage ?? ''} containerStyles={[styles.flexReset, styles.flexGrow0, styles.flexShrink0, styles.flexBasisAuto]} enabledWhenOffline /> ), - [inviteUser, policy?.alertMessage, selectedOptions.length, shouldShowAlertPrompt, styles.flexBasisAuto, styles.flexGrow0, styles.flexReset, styles.flexShrink0, translate], + [inviteUser, selectedOptions.length, shouldShowAlertPrompt, styles.flexBasisAuto, styles.flexGrow0, styles.flexReset, styles.flexShrink0, translate], ); useEffect(() => { diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index 3de5af15ca4bf..89f318f8bd805 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -1898,9 +1898,6 @@ type Policy = OnyxCommon.OnyxValueWithOfflineFeedback< /** Original file name which is used for the policy avatar */ originalFileName?: string; - /** Alert message for the policy */ - alertMessage?: string; - /** Informative messages about which policy members were added with primary logins when invited with their secondary login */ primaryLoginsInvited?: Record;