@@ -18,7 +18,6 @@ import DateUtils from './DateUtils';
1818import { getEnvironmentURL } from './Environment/Environment' ;
1919import { formatList } from './Localize' ;
2020import Log from './Log' ;
21- import { getPersonalDetailByEmail } from './PersonalDetailsUtils' ;
2221import {
2322 arePolicyRulesEnabled ,
2423 findVendorByID ,
@@ -153,7 +152,7 @@ function getForDistanceRequest(translate: LocalizedTranslate, newMerchant: strin
153152 return translate ( 'iou.updatedTheDistanceMerchant' , translatedChangedField , newMerchant , oldMerchant , newAmount , oldAmount ) ;
154153}
155154
156- function getForExpenseMovedFromSelfDM ( translate : LocalizedTranslate , destinationReport : OnyxEntry < Report > , currentUserLogin : string , policy : OnyxEntry < Policy > ) {
155+ function getForExpenseMovedFromSelfDM ( translate : LocalizedTranslate , destinationReport : OnyxEntry < Report > , currentUserAccountID : number | undefined , policy : OnyxEntry < Policy > ) {
157156 const rootParentReport = getRootParentReport ( { report : destinationReport } ) ;
158157 // In OldDot, expenses could be moved to a self-DM. Return the corresponding message for this case.
159158 if ( isSelfDM ( rootParentReport ) ) {
@@ -162,7 +161,6 @@ function getForExpenseMovedFromSelfDM(translate: LocalizedTranslate, destination
162161 // In NewDot, the "Move report" flow only supports moving expenses from self-DM to:
163162 // - A policy expense chat
164163 // - A 1:1 DM
165- const currentUserAccountID = getPersonalDetailByEmail ( currentUserLogin ) ?. accountID ;
166164 const reportName = isPolicyExpenseChat ( rootParentReport )
167165 ? getPolicyExpenseChatName ( { report : rootParentReport , translate} )
168166 : buildReportNameFromParticipantNames ( { report : rootParentReport , currentUserAccountID, translate} ) ;
@@ -187,12 +185,12 @@ function getMovedFromOrToReportMessage(
187185 translate : LocalizedTranslate ,
188186 movedFromReport : OnyxEntry < Report > | undefined ,
189187 movedToReport : OnyxEntry < Report > | undefined ,
190- currentUserLogin : string ,
188+ currentUserAccountID : number | undefined ,
191189 policy : OnyxEntry < Policy > ,
192190 reportAttributes ?: ReportAttributesDerivedValue [ 'reports' ] ,
193191) : string | undefined {
194192 if ( movedToReport ) {
195- return getForExpenseMovedFromSelfDM ( translate , movedToReport , currentUserLogin , policy ) ;
193+ return getForExpenseMovedFromSelfDM ( translate , movedToReport , currentUserAccountID , policy ) ;
196194 }
197195
198196 if ( movedFromReport ) {
@@ -276,6 +274,7 @@ function getForReportAction({
276274 movedToReport,
277275 policyTags,
278276 policyCategories,
277+ currentUserAccountID,
279278 currentUserLogin,
280279 reportAttributes,
281280} : {
@@ -290,14 +289,15 @@ function getForReportAction({
290289 // See https://github.com/Expensify/App/pull/75562
291290 policyTags ?: OnyxEntry < PolicyTagLists > ;
292291 policyCategories ?: OnyxEntry < PolicyCategories > ;
292+ currentUserAccountID : number | undefined ;
293293 currentUserLogin : string ;
294294 reportAttributes ?: ReportAttributesDerivedValue [ 'reports' ] ;
295295} ) : string {
296296 if ( ! isModifiedExpenseAction ( reportAction ) ) {
297297 return '' ;
298298 }
299299
300- const movedFromOrToReportMessage = getMovedFromOrToReportMessage ( translate , movedFromReport , movedToReport , currentUserLogin , policy , reportAttributes ) ;
300+ const movedFromOrToReportMessage = getMovedFromOrToReportMessage ( translate , movedFromReport , movedToReport , currentUserAccountID , policy , reportAttributes ) ;
301301 if ( movedFromOrToReportMessage ) {
302302 return movedFromOrToReportMessage ;
303303 }
0 commit comments