Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3350143
D10659.id35779.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
D10659.id35779.diff
View Options
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
@@ -9,6 +9,7 @@
deleteKeyserverAccountActionTypes,
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 +59,20 @@
[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 === setNewSessionActionType &&
action.payload.sessionChange.cookieInvalidated)
) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 8:56 PM (20 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2572420
Default Alt Text
D10659.id35779.diff (1 KB)
Attached To
Mode
D10659: [lib] Refactor logout in invite links reducer
Attached
Detach File
Event Timeline
Log In to Comment