diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index efd8ca63350d..9d1bb7ce5eda 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -3882,6 +3882,26 @@ function prepareOnboardingOptimisticData( guidedSetupData.push({type: 'video', ...data.video, ...videoMessage}); } + if (engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM) { + const selfDMReportID = ReportUtils.findSelfDMReportID(); + const selfDMReport = ReportConnection.getReport(selfDMReportID ?? '-1'); + optimisticData.push({ + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT}${selfDMReportID}`, + value: { + isPinned: false, + }, + }); + + failureData.push({ + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT}${selfDMReportID}`, + value: { + isPinned: selfDMReport?.isPinned, + }, + }); + } + guidedSetupData.push(...tasksForParameters); return {optimisticData, successData, failureData, guidedSetupData, actorAccountID};