@@ -338,10 +338,6 @@ function hasReceiptSource(transaction: OnyxInputOrEntry<Transaction>): boolean {
338338}
339339
340340function isMerchantMissing ( transaction : OnyxEntry < Transaction > ) {
341- if ( transaction ?. wasMerchantCleared ) {
342- return true ;
343- }
344-
345341 if ( transaction ?. modifiedMerchant && transaction . modifiedMerchant !== '' ) {
346342 return transaction . modifiedMerchant === CONST . TRANSACTION . PARTIAL_TRANSACTION_MERCHANT ;
347343 }
@@ -438,10 +434,6 @@ function getUpdatedTransaction({
438434 shouldStopSmartscan = true ;
439435 }
440436
441- if ( Object . hasOwn ( transactionChanges , 'wasMerchantCleared' ) ) {
442- updatedTransaction . wasMerchantCleared = transactionChanges . wasMerchantCleared ;
443- }
444-
445437 if ( Object . hasOwn ( transactionChanges , 'waypoints' ) ) {
446438 updatedTransaction . modifiedWaypoints = transactionChanges . waypoints ;
447439 updatedTransaction . isLoading = true ;
@@ -701,12 +693,8 @@ function isUnreportedAndHasInvalidDistanceRateTransaction(transaction: OnyxInput
701693 * Return the merchant field from the transaction, return the modifiedMerchant if present.
702694 */
703695function getMerchant ( transaction : OnyxInputOrEntry < Transaction > , policyParam : OnyxEntry < Policy > = undefined ) : string {
704- if ( ! transaction ) {
705- return '' ;
706- }
707-
708- const report = getReportOrDraftReport ( transaction . reportID ) ;
709- if ( isDistanceRequest ( transaction ) ) {
696+ if ( transaction && isDistanceRequest ( transaction ) ) {
697+ const report = getReportOrDraftReport ( transaction . reportID ) ;
710698 // This will be fixed as part of https://github.com/Expensify/Expensify/issues/507850
711699 // eslint-disable-next-line deprecation/deprecation
712700 const policy = policyParam ?? getPolicy ( report ?. policyID ) ;
@@ -719,12 +707,7 @@ function getMerchant(transaction: OnyxInputOrEntry<Transaction>, policyParam: On
719707 ) ;
720708 }
721709 }
722-
723- // Check if merchant was intentionally cleared by user (only for personal expenses)
724- if ( transaction . wasMerchantCleared ) {
725- return '' ;
726- }
727- return transaction . modifiedMerchant ? transaction . modifiedMerchant : ( transaction . merchant ?? '' ) ;
710+ return transaction ?. modifiedMerchant ? transaction . modifiedMerchant : ( transaction ?. merchant ?? '' ) ;
728711}
729712
730713function getMerchantOrDescription ( transaction : OnyxEntry < Transaction > ) {
0 commit comments