diff --git a/src/libs/migrations/RemoveEmptyReportActionsDrafts.ts b/src/libs/migrations/RemoveEmptyReportActionsDrafts.ts index 24debda2e492..e063bdd67093 100644 --- a/src/libs/migrations/RemoveEmptyReportActionsDrafts.ts +++ b/src/libs/migrations/RemoveEmptyReportActionsDrafts.ts @@ -1,5 +1,5 @@ import _ from 'lodash'; -import type {OnyxEntry} from 'react-native-onyx'; +import type {OnyxEntry, OnyxInputValue} from 'react-native-onyx'; import Onyx from 'react-native-onyx'; import Log from '@libs/Log'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -24,7 +24,7 @@ export default function (): Promise { return resolve(); } - const newReportActionsDrafts: Record> = {}; + const newReportActionsDrafts: Record> = {}; Object.entries(allReportActionsDrafts).forEach(([onyxKey, reportActionDrafts]) => { const newReportActionsDraftsForReport: Record = {}; @@ -54,7 +54,7 @@ export default function (): Promise { if (isEmptyObject(newReportActionsDraftsForReport)) { Log.info('[Migrate Onyx] NO REMAINING'); // Clear if there are no drafts remaining - newReportActionsDrafts[onyxKey as ReportActionsDraftsKey] = undefined; + newReportActionsDrafts[onyxKey as ReportActionsDraftsKey] = null; } else if (hasUnmigratedDraft) { // Only migrate if there are unmigrated drafts, there's no need to overwrite this onyx key with the same data newReportActionsDrafts[onyxKey as ReportActionsDraftsKey] = newReportActionsDraftsForReport;