Skip to content

Commit

Permalink
make the code more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Oct 25, 2023
1 parent c8286e8 commit 9edcd3b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libs/migrations/KeyReportActionsDraftByReportActionID.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ export default function () {

const reportActionID = onyxKey.split('_').pop();
const newOnyxKey = onyxKey.replace(`_${reportActionID}`, '');

// If newReportActionsDrafts[newOnyxKey] isn't set, fall back on the migrated draft if there is one
const currentActionsDrafts = newReportActionsDrafts[newOnyxKey] || allReportActionsDrafts[newOnyxKey];
newReportActionsDrafts[newOnyxKey] = {
...(newReportActionsDrafts[newOnyxKey] ||
// Includes the existing migrated draft
allReportActionsDrafts[newOnyxKey]),
...currentActionsDrafts,
[reportActionID]: reportActionDraft,
};
});
Expand Down

0 comments on commit 9edcd3b

Please sign in to comment.