Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3354715
D10768.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
D10768.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
@@ -288,11 +288,11 @@
};
} else if (action.type === updateConnectionStatusActionType) {
const { keyserverID, status } = action.payload;
- return {
- ...state,
- keyserverInfos: {
- ...state.keyserverInfos,
- [keyserverID]: {
+ const operation: ReplaceKeyserverOperation = {
+ type: 'replace_keyserver',
+ payload: {
+ id: keyserverID,
+ keyserverInfo: {
...state.keyserverInfos[keyserverID],
connection: {
...state.keyserverInfos[keyserverID].connection,
@@ -302,13 +302,17 @@
},
},
};
- } else if (action.type === unsupervisedBackgroundActionType) {
- const { keyserverID } = action.payload;
return {
...state,
- keyserverInfos: {
- ...state.keyserverInfos,
- [keyserverID]: {
+ keyserverInfos: processStoreOps(state.keyserverInfos, [operation]),
+ };
+ } else if (action.type === unsupervisedBackgroundActionType) {
+ const { keyserverID } = action.payload;
+ const operation: ReplaceKeyserverOperation = {
+ type: 'replace_keyserver',
+ payload: {
+ id: keyserverID,
+ keyserverInfo: {
...state.keyserverInfos[keyserverID],
connection: {
...state.keyserverInfos[keyserverID].connection,
@@ -318,6 +322,10 @@
},
},
};
+ return {
+ ...state,
+ keyserverInfos: processStoreOps(state.keyserverInfos, [operation]),
+ };
} else if (action.type === queueActivityUpdatesActionType) {
const { activityUpdates, keyserverID } = action.payload;
const oldConnection = state.keyserverInfos[keyserverID].connection;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 1:09 PM (20 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2575897
Default Alt Text
D10768.diff (1 KB)
Attached To
Mode
D10768: [lib] refactor updating connection status in `keyserver-reducer` to ops
Attached
Detach File
Event Timeline
Log In to Comment