Page MenuHomePhabricator

D10772.id35947.diff
No OneTemporary

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

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)

Event Timeline