Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3352448
D7664.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7664.diff
View Options
diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js
--- a/lib/reducers/message-reducer.js
+++ b/lib/reducers/message-reducer.js
@@ -1613,8 +1613,14 @@
},
};
} else if (action.type === setClientDBStoreActionType) {
+ const payloadMessages = action.payload.messages;
+ if (!payloadMessages) {
+ return { messageStoreOperations: [], messageStore };
+ }
const actionPayloadMessageStoreThreads =
- translateClientDBThreadMessageInfos(action.payload.messageStoreThreads);
+ translateClientDBThreadMessageInfos(
+ action.payload.messageStoreThreads ?? [],
+ );
const newThreads = {};
for (const threadID in actionPayloadMessageStoreThreads) {
@@ -1649,7 +1655,7 @@
}
const threadsNeedMsgIDsResorting = new Set();
const actionPayloadMessages =
- translateClientDBMessageInfosToRawMessageInfos(action.payload.messages);
+ translateClientDBMessageInfosToRawMessageInfos(payloadMessages);
// When starting the app on native, we filter out any local-only multimedia
// messages because the relevant context is no longer available
diff --git a/lib/reducers/thread-reducer.js b/lib/reducers/thread-reducer.js
--- a/lib/reducers/thread-reducer.js
+++ b/lib/reducers/thread-reducer.js
@@ -473,7 +473,7 @@
};
} else if (action.type === setClientDBStoreActionType) {
return {
- threadStore: action.payload.threadStore,
+ threadStore: action.payload.threadStore ?? state,
newThreadInconsistencies: [],
threadStoreOperations: [],
};
diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js
--- a/lib/types/redux-types.js
+++ b/lib/types/redux-types.js
@@ -599,9 +599,9 @@
+payload: {
+currentUserID: ?string,
+drafts: $ReadOnlyArray<ClientDBDraftInfo>,
- +messages: $ReadOnlyArray<ClientDBMessageInfo>,
- +threadStore: ThreadStore,
- +messageStoreThreads: $ReadOnlyArray<ClientDBThreadMessageInfo>,
+ +messages: ?$ReadOnlyArray<ClientDBMessageInfo>,
+ +threadStore: ?ThreadStore,
+ +messageStoreThreads: ?$ReadOnlyArray<ClientDBThreadMessageInfo>,
},
}
| {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 5:58 AM (20 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2574209
Default Alt Text
D7664.diff (2 KB)
Attached To
Mode
D7664: [lib] make fields in setting client store action optional
Attached
Detach File
Event Timeline
Log In to Comment