Page MenuHomePhabricator

D10771.id35945.diff
No OneTemporary

D10771.id35945.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
@@ -423,11 +423,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,
@@ -436,13 +436,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,
@@ -451,6 +456,10 @@
},
},
};
+ return {
+ ...state,
+ keyserverInfos: processStoreOps(state.keyserverInfos, [operation]),
+ };
} else if (action.type === setDeviceTokenActionTypes.success) {
const { deviceTokens } = action.payload;
const keyserverInfos: { ...KeyserverInfos } = { ...state.keyserverInfos };
@@ -466,11 +475,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,
@@ -479,6 +488,10 @@
},
},
};
+ return {
+ ...state,
+ keyserverInfos: processStoreOps(state.keyserverInfos, [operation]),
+ };
}
return state;

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 7:26 PM (8 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2700891
Default Alt Text
D10771.id35945.diff (2 KB)

Event Timeline