Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3377924
D10771.id36399.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
D10771.id36399.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
@@ -462,11 +462,11 @@
} else {
lateResponsesSet.delete(messageID);
}
- return {
- ...state,
- keyserverInfos: {
- ...state.keyserverInfos,
- [keyserverID]: {
+ const operation: ReplaceKeyserverOperation = {
+ type: 'replace_keyserver',
+ payload: {
+ id: keyserverID,
+ keyserverInfo: {
...state.keyserverInfos[keyserverID],
connection: {
...state.keyserverInfos[keyserverID].connection,
@@ -475,13 +475,18 @@
},
},
};
- } else if (action.type === updateDisconnectedBarActionType) {
- const { keyserverID } = action.payload;
+
return {
...state,
- keyserverInfos: {
- ...state.keyserverInfos,
- [keyserverID]: {
+ keyserverInfos: processStoreOps(state.keyserverInfos, [operation]),
+ };
+ } else if (action.type === updateDisconnectedBarActionType) {
+ const { keyserverID } = action.payload;
+ const operation: ReplaceKeyserverOperation = {
+ type: 'replace_keyserver',
+ payload: {
+ id: keyserverID,
+ keyserverInfo: {
...state.keyserverInfos[keyserverID],
connection: {
...state.keyserverInfos[keyserverID].connection,
@@ -490,6 +495,10 @@
},
},
};
+ return {
+ ...state,
+ keyserverInfos: processStoreOps(state.keyserverInfos, [operation]),
+ };
} else if (action.type === setDeviceTokenActionTypes.success) {
const { deviceTokens } = action.payload;
const keyserverInfos: { ...KeyserverInfos } = { ...state.keyserverInfos };
@@ -505,11 +514,11 @@
};
} else if (action.type === setConnectionIssueActionType) {
const { connectionIssue, keyserverID } = 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,
@@ -518,6 +527,10 @@
},
},
};
+ return {
+ ...state,
+ keyserverInfos: processStoreOps(state.keyserverInfos, [operation]),
+ };
}
return state;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 8:10 AM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2593351
Default Alt Text
D10771.id36399.diff (2 KB)
Attached To
Mode
D10771: [lib] refactor connection-related actions in `keyserver-reducer` to ops
Attached
Detach File
Event Timeline
Log In to Comment