Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32213812
D10768.1765149552.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D10768.1765149552.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, Dec 7, 11:19 PM (15 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5844155
Default Alt Text
D10768.1765149552.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