Page MenuHomePhabricator

D10760.diff
No OneTemporary

D10760.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
@@ -111,34 +111,45 @@
}
return state;
}
+
+ let newKeyserverInfo = {
+ ...state.keyserverInfos[keyserverID],
+ };
+ let keyserverUpdated = false;
+
if (sessionChange.cookie !== undefined) {
- state = {
- ...state,
- keyserverInfos: {
- ...state.keyserverInfos,
- [keyserverID]: {
- ...state.keyserverInfos[keyserverID],
- cookie: sessionChange.cookie,
- },
- },
+ newKeyserverInfo = {
+ ...newKeyserverInfo,
+ cookie: sessionChange.cookie,
};
+ keyserverUpdated = true;
}
if (sessionChange.cookieInvalidated) {
- state = {
- ...state,
- keyserverInfos: {
- ...state.keyserverInfos,
- [keyserverID]: {
- ...state.keyserverInfos[keyserverID],
- connection: {
- ...state.keyserverInfos[keyserverID].connection,
- queuedActivityUpdates: [],
- },
- },
+ newKeyserverInfo = {
+ ...newKeyserverInfo,
+ connection: {
+ ...newKeyserverInfo.connection,
+ queuedActivityUpdates: [],
},
};
+ keyserverUpdated = true;
}
- return state;
+
+ const operations: ReplaceKeyserverOperation[] = [];
+ if (keyserverUpdated) {
+ operations.push({
+ type: 'replace_keyserver',
+ payload: {
+ id: keyserverID,
+ keyserverInfo: newKeyserverInfo,
+ },
+ });
+ }
+
+ return {
+ ...state,
+ keyserverInfos: processStoreOps(state.keyserverInfos, operations),
+ };
} else if (
action.type === logInActionTypes.success ||
action.type === siweAuthActionTypes.success ||

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 7:17 AM (21 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2517837
Default Alt Text
D10760.diff (1 KB)

Event Timeline