diff --git a/native/redux/persist.js b/native/redux/persist.js --- a/native/redux/persist.js +++ b/native/redux/persist.js @@ -81,6 +81,7 @@ } from 'lib/types/alert-types.js'; import { defaultEnabledApps } from 'lib/types/enabled-apps.js'; import { defaultCalendarQuery } from 'lib/types/entry-types.js'; +import type { EntryStore } from 'lib/types/entry-types.js'; import { defaultCalendarFilters } from 'lib/types/filter-types.js'; import type { KeyserverInfo } from 'lib/types/keyserver-types.js'; import { @@ -1345,6 +1346,19 @@ { whitelist: ['reportStore'] }, ); +type PersistedEntryStore = { + +lastUserInteractionCalendar: number, +}; +const entryStoreTransform: Transform = createTransform( + (state: EntryStore): PersistedEntryStore => { + return { lastUserInteractionCalendar: state.lastUserInteractionCalendar }; + }, + (state: PersistedEntryStore): EntryStore => { + return { ...state, entryInfos: {}, daysToEntries: {} }; + }, + { whitelist: ['entryStore'] }, +); + const migrations = { // This migration doesn't change the store but sets a persisted version // in the DB @@ -1451,6 +1465,7 @@ messageStoreMessagesBlocklistTransform, reportStoreTransform, keyserverStoreTransform, + entryStoreTransform, ], migrate: (createAsyncMigrate( legacyMigrations,