Page MenuHomePhabricator

D10769.diff
No OneTemporary

D10769.diff

diff --git a/lib/reducers/keyserver-reducer.js b/lib/reducers/keyserver-reducer.js
--- a/lib/reducers/keyserver-reducer.js
+++ b/lib/reducers/keyserver-reducer.js
@@ -349,37 +349,46 @@
],
};
- return {
- ...state,
- keyserverInfos: {
- ...state.keyserverInfos,
- [keyserverID]: {
+ const operation: ReplaceKeyserverOperation = {
+ type: 'replace_keyserver',
+ payload: {
+ id: keyserverID,
+ keyserverInfo: {
...state.keyserverInfos[keyserverID],
connection,
},
},
};
+
+ return {
+ ...state,
+ keyserverInfos: processStoreOps(state.keyserverInfos, [operation]),
+ };
} else if (action.type === updateActivityActionTypes.success) {
const { activityUpdates } = action.payload;
- let keyserverInfos = { ...state.keyserverInfos };
+
+ const operations: ReplaceKeyserverOperation[] = [];
for (const keyserverID in activityUpdates) {
- const oldConnection = keyserverInfos[keyserverID].connection;
+ const oldConnection = state.keyserverInfos[keyserverID].connection;
const queuedActivityUpdates = oldConnection.queuedActivityUpdates.filter(
activityUpdate =>
!activityUpdates[keyserverID].includes(activityUpdate),
);
- keyserverInfos = {
- ...keyserverInfos,
- [keyserverID]: {
- ...keyserverInfos[keyserverID],
- connection: { ...oldConnection, queuedActivityUpdates },
+ operations.push({
+ type: 'replace_keyserver',
+ payload: {
+ id: keyserverID,
+ keyserverInfo: {
+ ...state.keyserverInfos[keyserverID],
+ connection: { ...oldConnection, queuedActivityUpdates },
+ },
},
- };
+ });
}
return {
...state,
- keyserverInfos,
+ keyserverInfos: processStoreOps(state.keyserverInfos, operations),
};
} else if (
action.type === logOutActionTypes.success ||

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 1:56 PM (18 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2576102
Default Alt Text
D10769.diff (1 KB)

Event Timeline