Skip to content

Commit 57ae961

Browse files
author
Christoph Pader
committed
fix: RemoveEMptyActionDrafts
1 parent e6bcbe6 commit 57ae961

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libs/migrations/RemoveEmptyReportActionsDrafts.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import _ from 'lodash';
2-
import type {OnyxEntry} from 'react-native-onyx';
2+
import type {OnyxEntry, OnyxInputValue} from 'react-native-onyx';
33
import Onyx from 'react-native-onyx';
44
import Log from '@libs/Log';
55
import ONYXKEYS from '@src/ONYXKEYS';
@@ -24,7 +24,7 @@ export default function (): Promise<void> {
2424
return resolve();
2525
}
2626

27-
const newReportActionsDrafts: Record<ReportActionsDraftsKey, OnyxEntry<ReportActionsDrafts>> = {};
27+
const newReportActionsDrafts: Record<ReportActionsDraftsKey, OnyxInputValue<ReportActionsDrafts>> = {};
2828
Object.entries(allReportActionsDrafts).forEach(([onyxKey, reportActionDrafts]) => {
2929
const newReportActionsDraftsForReport: Record<string, ReportActionsDraft> = {};
3030

@@ -54,7 +54,7 @@ export default function (): Promise<void> {
5454
if (isEmptyObject(newReportActionsDraftsForReport)) {
5555
Log.info('[Migrate Onyx] NO REMAINING');
5656
// Clear if there are no drafts remaining
57-
newReportActionsDrafts[onyxKey as ReportActionsDraftsKey] = undefined;
57+
newReportActionsDrafts[onyxKey as ReportActionsDraftsKey] = null;
5858
} else if (hasUnmigratedDraft) {
5959
// Only migrate if there are unmigrated drafts, there's no need to overwrite this onyx key with the same data
6060
newReportActionsDrafts[onyxKey as ReportActionsDraftsKey] = newReportActionsDraftsForReport;

0 commit comments

Comments
 (0)