Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3526063
D10772.id36380.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
D10772.id36380.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
@@ -28,7 +28,7 @@
type KeyserverStoreOperation,
} from '../ops/keyserver-store-ops.js';
import { queueActivityUpdatesActionType } from '../types/activity-types.js';
-import type { KeyserverInfos, KeyserverStore } from '../types/keyserver-types';
+import type { KeyserverStore, KeyserverInfos } from '../types/keyserver-types';
import type { BaseAction } from '../types/redux-types.js';
import {
fullStateSyncActionType,
@@ -501,16 +501,22 @@
};
} else if (action.type === setDeviceTokenActionTypes.success) {
const { deviceTokens } = action.payload;
- const keyserverInfos: { ...KeyserverInfos } = { ...state.keyserverInfos };
+ const operations: ReplaceKeyserverOperation[] = [];
for (const keyserverID in deviceTokens) {
- keyserverInfos[keyserverID] = {
- ...keyserverInfos[keyserverID],
- deviceToken: deviceTokens[keyserverID],
- };
+ operations.push({
+ type: 'replace_keyserver',
+ payload: {
+ id: keyserverID,
+ keyserverInfo: {
+ ...state.keyserverInfos[keyserverID],
+ deviceToken: deviceTokens[keyserverID],
+ },
+ },
+ });
}
return {
...state,
- keyserverInfos,
+ keyserverInfos: processStoreOps(state.keyserverInfos, operations),
};
} else if (action.type === setConnectionIssueActionType) {
const { connectionIssue, keyserverID } = action.payload;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 7:26 PM (8 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2700233
Default Alt Text
D10772.id36380.diff (1 KB)
Attached To
Mode
D10772: [lib] refactor setting device token in `keyserver-reducer` to ops
Attached
Detach File
Event Timeline
Log In to Comment