Page MenuHomePhabricator

D10659.diff
No OneTemporary

D10659.diff

diff --git a/lib/reducers/invite-links-reducer.js b/lib/reducers/invite-links-reducer.js
--- a/lib/reducers/invite-links-reducer.js
+++ b/lib/reducers/invite-links-reducer.js
@@ -7,8 +7,10 @@
} from '../actions/link-actions.js';
import {
deleteKeyserverAccountActionTypes,
+ deleteAccountActionTypes,
logOutActionTypes,
} from '../actions/user-actions.js';
+import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js';
import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js';
import type { InviteLinksStore, CommunityLinks } from '../types/link-types.js';
import type { BaseAction } from '../types/redux-types.js';
@@ -58,9 +60,21 @@
[communityID]: communityLinks,
},
};
+ } else if (action.type === deleteKeyserverAccountActionTypes.success) {
+ const keyserverIDsSet = new Set<string>(action.payload.keyserverIDs);
+ const newLinks: { [communityID: string]: CommunityLinks } = {};
+ for (const linkID in state.links) {
+ if (!keyserverIDsSet.has(extractKeyserverIDFromID(linkID))) {
+ newLinks[linkID] = state.links[linkID];
+ }
+ }
+ return {
+ ...state,
+ links: newLinks,
+ };
} else if (
action.type === logOutActionTypes.success ||
- action.type === deleteKeyserverAccountActionTypes.success ||
+ action.type === deleteAccountActionTypes.success ||
(action.type === setNewSessionActionType &&
action.payload.sessionChange.cookieInvalidated)
) {

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 5:18 PM (16 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2571696
Default Alt Text
D10659.diff (1 KB)

Event Timeline