From 75d811d298a68d2130b044db66031bfc04b69aee Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Thu, 25 Feb 2021 14:46:08 -0500 Subject: [PATCH] groups: reduce added member from pending Fixes urbit/landscape#490 --- pkg/interface/src/logic/reducers/group-update.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/interface/src/logic/reducers/group-update.ts b/pkg/interface/src/logic/reducers/group-update.ts index c4aeddb0a..49a620edf 100644 --- a/pkg/interface/src/logic/reducers/group-update.ts +++ b/pkg/interface/src/logic/reducers/group-update.ts @@ -61,6 +61,7 @@ export default class GroupReducer { reduce(json: Cage, state: S) { const data = json.groupUpdate; if (data) { + console.log(data); this.initial(data, state); this.addMembers(data, state); this.addTag(data, state); @@ -116,6 +117,12 @@ export default class GroupReducer { const resourcePath = resourceAsPath(resource); for (const member of ships) { state.groups[resourcePath].members.add(member); + if ( + 'invite' in state.groups[resourcePath].policy && + state.groups[resourcePath].policy.invite.pending.has(member) + ) { + state.groups[resourcePath].policy.invite.pending.delete(member) + } } } }