Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3355044
D10769.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
D10769.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D10769: [lib] refactor activity-related code in `keyserver-reducer` to ops
Attached
Detach File
Event Timeline
Log In to Comment