Page MenuHomePhabricator

D10771.id36399.diff
No OneTemporary

D10771.id36399.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
@@ -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

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)

Event Timeline