diff --git a/lib/reducers/entry-reducer.js b/lib/reducers/entry-reducer.js --- a/lib/reducers/entry-reducer.js +++ b/lib/reducers/entry-reducer.js @@ -588,23 +588,25 @@ return [entryStore, []]; } - let updatedEntryInfos = { ...entryInfos }; + const updatedEntryInfos: { [string]: RawEntryInfo } = { ...entryInfos }; if (deleteEntryIDs) { for (const deleteEntryID of deleteEntryIDs) { delete updatedEntryInfos[deleteEntryID]; } } - let updatedDaysToEntries; + let mergedEntryInfos: { +[string]: RawEntryInfo }; + let mergedDaysToEntries; if (rawEntryInfos) { - [updatedEntryInfos, updatedDaysToEntries] = mergeNewEntryInfos( + [mergedEntryInfos, mergedDaysToEntries] = mergeNewEntryInfos( updatedEntryInfos, null, rawEntryInfos, newThreadInfos, ); } else { - updatedDaysToEntries = daysToEntriesFromEntryInfos( + mergedEntryInfos = updatedEntryInfos; + mergedDaysToEntries = daysToEntriesFromEntryInfos( values(updatedEntryInfos), ); } @@ -612,13 +614,13 @@ const newInconsistencies = stateSyncSpecs.entries.findStoreInconsistencies( action, entryInfos, - updatedEntryInfos, + mergedEntryInfos, ); return [ { - entryInfos: updatedEntryInfos, - daysToEntries: updatedDaysToEntries, + entryInfos: mergedEntryInfos, + daysToEntries: mergedDaysToEntries, lastUserInteractionCalendar, }, newInconsistencies,