Skip to content

Commit

Permalink
fix: remove pinned SelfDM for new users
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer committed Nov 27, 2024
1 parent c4ff235 commit 901ae74
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3882,6 +3882,27 @@ function prepareOnboardingOptimisticData(
guidedSetupData.push({type: 'video', ...data.video, ...videoMessage});
}

const selfDMReportID = ReportUtils.findSelfDMReportID();
const selfDMReport = ReportConnection.getReport(selfDMReportID ?? '-1');

if (engagementChoice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM) {
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};
Expand Down

0 comments on commit 901ae74

Please sign in to comment.