Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3355675
D10763.id35918.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
D10763.id35918.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
@@ -170,16 +170,21 @@
};
} else if (action.type === fullStateSyncActionType) {
const { keyserverID } = action.payload;
- return {
- ...state,
- keyserverInfos: {
- ...state.keyserverInfos,
- [keyserverID]: {
+ const operation: ReplaceKeyserverOperation = {
+ type: 'replace_keyserver',
+ payload: {
+ id: keyserverID,
+ keyserverInfo: {
...state.keyserverInfos[keyserverID],
updatesCurrentAsOf: action.payload.updatesCurrentAsOf,
},
},
};
+
+ return {
+ ...state,
+ keyserverInfos: processStoreOps(state.keyserverInfos, [operation]),
+ };
} else if (action.type === incrementalStateSyncActionType) {
const { keyserverID } = action.payload;
let { deviceToken } = state.keyserverInfos[keyserverID];
@@ -192,17 +197,22 @@
break;
}
}
- return {
- ...state,
- keyserverInfos: {
- ...state.keyserverInfos,
- [keyserverID]: {
+ const operation: ReplaceKeyserverOperation = {
+ type: 'replace_keyserver',
+ payload: {
+ id: keyserverID,
+ keyserverInfo: {
...state.keyserverInfos[keyserverID],
updatesCurrentAsOf: action.payload.updatesResult.currentAsOf,
deviceToken,
},
},
};
+
+ return {
+ ...state,
+ keyserverInfos: processStoreOps(state.keyserverInfos, [operation]),
+ };
} else if (action.type === processUpdatesActionType) {
const { keyserverID } = action.payload;
const updatesCurrentAsOf = Math.max(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 2:59 PM (21 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2576486
Default Alt Text
D10763.id35918.diff (1 KB)
Attached To
Mode
D10763: [lib] refactor state-sync actions in `keyserver-reducer` to ops
Attached
Detach File
Event Timeline
Log In to Comment