Page MenuHomePhabricator

D10772.diff
No OneTemporary

D10772.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
@@ -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

Mime Type
text/plain
Expires
Thu, Nov 28, 5:54 AM (21 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2592979
Default Alt Text
D10772.diff (1 KB)

Event Timeline