Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3526062
D10772.id35947.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.id35947.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
@@ -27,7 +27,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 } from '../types/keyserver-types';
import type { BaseAction } from '../types/redux-types.js';
import {
fullStateSyncActionType,
@@ -462,16 +462,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, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2700892
Default Alt Text
D10772.id35947.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