Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3276042
D10760.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10760.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
@@ -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
Details
Attached
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)
Attached To
Mode
D10760: [lib] refactor set new session in `keyserver-reducer` to ops
Attached
Detach File
Event Timeline
Log In to Comment