diff --git a/native/redux/persist.js b/native/redux/persist.js --- a/native/redux/persist.js +++ b/native/redux/persist.js @@ -11,6 +11,7 @@ import { inconsistencyResponsesToReports } from 'lib/shared/report-utils'; import { getContainingThreadID, getCommunity } from 'lib/shared/thread-utils'; import { unshimMessageStore } from 'lib/shared/unshim-utils'; +import type { DraftStore } from 'lib/types/draft-types'; import { defaultEnabledApps } from 'lib/types/enabled-apps'; import { defaultCalendarFilters } from 'lib/types/filter-types'; import { @@ -418,6 +419,19 @@ { whitelist: ['messageStore'] }, ); +type PersistedDraftStore = {}; + +const draftStoreDraftsBlocklistTransform: Transform = createTransform( + (state: DraftStore): PersistedDraftStore => { + const { drafts, ...draftStoreSansDrafts } = state; + return draftStoreSansDrafts; + }, + (state: PersistedDraftStore): DraftStore => { + return { ...state, drafts: {} }; + }, + { whitelist: ['draftStore'] }, +); + const persistConfig = { key: 'root', storage: AsyncStorage, @@ -432,7 +446,10 @@ ], debug: __DEV__, version: 31, - transforms: [messageStoreMessagesBlocklistTransform], + transforms: [ + messageStoreMessagesBlocklistTransform, + draftStoreDraftsBlocklistTransform, + ], migrate: (createMigrate(migrations, { debug: __DEV__ }): any), timeout: ((__DEV__ ? 0 : undefined): number | void), };