Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3361203
D5645.id18465.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5645.id18465.diff
View Options
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),
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 3:44 PM (20 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2580355
Default Alt Text
D5645.id18465.diff (1 KB)
Attached To
Mode
D5645: Make sure drafts are not persisted via redux-persist but a placeholder is created upon rehydration
Attached
Detach File
Event Timeline
Log In to Comment