mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-05 08:45:13 +03:00
Merge pull request #4504 from urbit/mp/groups/reduce-pendings
groups: reduce added member from pending
This commit is contained in:
commit
3805f55b43
@ -61,6 +61,7 @@ export default class GroupReducer<S extends GroupState> {
|
|||||||
reduce(json: Cage, state: S) {
|
reduce(json: Cage, state: S) {
|
||||||
const data = json.groupUpdate;
|
const data = json.groupUpdate;
|
||||||
if (data) {
|
if (data) {
|
||||||
|
console.log(data);
|
||||||
this.initial(data, state);
|
this.initial(data, state);
|
||||||
this.addMembers(data, state);
|
this.addMembers(data, state);
|
||||||
this.addTag(data, state);
|
this.addTag(data, state);
|
||||||
@ -116,6 +117,12 @@ export default class GroupReducer<S extends GroupState> {
|
|||||||
const resourcePath = resourceAsPath(resource);
|
const resourcePath = resourceAsPath(resource);
|
||||||
for (const member of ships) {
|
for (const member of ships) {
|
||||||
state.groups[resourcePath].members.add(member);
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user