Skip to content

Commit

Permalink
remove lastContactPermissionPrompt
Browse files Browse the repository at this point in the history
  • Loading branch information
perunt committed Dec 9, 2024
1 parent c1fa17b commit 560cb80
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
4 changes: 0 additions & 4 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ const ONYXKEYS = {
/** Last date (yyyy-MM-dd HH:mm:ss) when the location permission prompt was shown. */
NVP_LAST_LOCATION_PERMISSION_PROMPT: 'nvp_lastLocalPermissionPrompt',

/** Last date (yyyy-MM-dd HH:mm:ss) when the location permission prompt was shown. */
NVP_LAST_CONTACT_PERMISSION_PROMPT: 'nvp_lastLocalPermissionPrompt',

/** This NVP holds to most recent waypoints that a person has used when creating a distance expense */
NVP_RECENT_WAYPOINTS: 'nvp_expensify_recentWaypoints',

Expand Down Expand Up @@ -927,7 +924,6 @@ type OnyxValuesMapping = {
[ONYXKEYS.FOCUS_MODE_NOTIFICATION]: boolean;
[ONYXKEYS.NVP_LAST_PAYMENT_METHOD]: OnyxTypes.LastPaymentMethod;
[ONYXKEYS.NVP_LAST_LOCATION_PERMISSION_PROMPT]: string;
[ONYXKEYS.NVP_LAST_CONTACT_PERMISSION_PROMPT]: string;
[ONYXKEYS.LAST_EXPORT_METHOD]: OnyxTypes.LastExportMethod;
[ONYXKEYS.NVP_RECENT_WAYPOINTS]: OnyxTypes.RecentWaypoint[];
[ONYXKEYS.NVP_INTRO_SELECTED]: OnyxTypes.IntroSelected;
Expand Down
5 changes: 0 additions & 5 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8391,10 +8391,6 @@ function updateLastLocationPermissionPrompt() {
Onyx.set(ONYXKEYS.NVP_LAST_LOCATION_PERMISSION_PROMPT, new Date().toISOString());
}

function updateLastContactPermissionPrompt() {
Onyx.set(ONYXKEYS.NVP_LAST_CONTACT_PERMISSION_PROMPT, new Date().toISOString());
}

/** Instead of merging the duplicates, it updates the transaction we want to keep and puts the others on hold without deleting them */
function resolveDuplicates(params: TransactionMergeParams) {
const originalSelectedTransaction = allTransactions[`${ONYXKEYS.COLLECTION.TRANSACTION}${params.transactionID}`];
Expand Down Expand Up @@ -8610,6 +8606,5 @@ export {
updateLastLocationPermissionPrompt,
resolveDuplicates,
getIOUReportActionToApproveOrPay,
updateLastContactPermissionPrompt,
};
export type {GPSPoint as GpsPoint, IOURequestType};
5 changes: 1 addition & 4 deletions src/pages/iou/request/MoneyRequestParticipantsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import useNetwork from '@hooks/useNetwork';
import usePolicy from '@hooks/usePolicy';
import useScreenWrapperTranstionStatus from '@hooks/useScreenWrapperTransitionStatus';
import useThemeStyles from '@hooks/useThemeStyles';
import {updateLastContactPermissionPrompt} from '@libs/actions/IOU';
import contactImport from '@libs/ContactImport';
import type {ContactImportResult} from '@libs/ContactImport/types';
import {getContactPermission} from '@libs/ContactPermission';
Expand Down Expand Up @@ -95,7 +94,6 @@ function MoneyRequestParticipantsSelector({
const policy = usePolicy(activePolicyID);
const [isSearchingForReports] = useOnyx(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, {initWithStoredValues: false});
const [currentUserLogin] = useOnyx(ONYXKEYS.SESSION, {selector: (session) => session?.email});
const [lastLocationPermissionPrompt] = useOnyx(ONYXKEYS.NVP_LAST_CONTACT_PERMISSION_PROMPT);
const {options, areOptionsInitialized} = useOptionsList({
shouldInitialize: didScreenTransitionEnd,
});
Expand Down Expand Up @@ -453,7 +451,6 @@ function MoneyRequestParticipantsSelector({

const handleSoftPermissionDeny = useCallback(() => {
setSoftPermissionModalVisible(false);
updateLastContactPermissionPrompt();
}, []);

const footerContent = useMemo(() => {
Expand Down Expand Up @@ -550,7 +547,7 @@ function MoneyRequestParticipantsSelector({

return (
<>
{!lastLocationPermissionPrompt && softPermissionModalVisible && (
{softPermissionModalVisible && (
<ContactPermissionModal
startPermissionFlow={softPermissionModalVisible}
resetPermissionFlow={handleSoftPermissionDeny}
Expand Down

0 comments on commit 560cb80

Please sign in to comment.