Skip to content

Commit

Permalink
Fix disappearing groups after removing one group form a space
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Jan 24, 2023
1 parent 7714ba8 commit 3f3e896
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelog/unreleased/enhancement-share-group-members
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ In detail it contains:
* All users / groups who only have access on a share level inside a sub-resource of a space can not see all groups which are regular members of the space

https://github.com/owncloud/web/pull/8161
https://github.com/owncloud/web/pull/8300
https://github.com/owncloud/web/issues/8160
https://github.com/owncloud/web/issues/8177
https://github.com/owncloud/web/issues/8299
8 changes: 6 additions & 2 deletions packages/web-runtime/src/store/spaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ const mutations = {
state.spaceMembers = members
},
UPSERT_SPACE_MEMBERS(state, member) {
// group shares don't have the name prop... distinguish by shareType
const checkAttr = member.collaborator.name ? 'name' : 'displayName'
const memberIndex = state.spaceMembers.findIndex((s) => {
return member.id === s.id && member.collaborator.name === s.collaborator.name
return member.id === s.id && member.collaborator[checkAttr] === s.collaborator[checkAttr]
})

if (memberIndex >= 0) {
Expand All @@ -100,8 +102,10 @@ const mutations = {
}
},
REMOVE_SPACE_MEMBER(state, member) {
// group shares don't have the name prop... distinguish by shareType
const checkAttr = member.collaborator.name ? 'name' : 'displayName'
state.spaceMembers = state.spaceMembers.filter(
(s) => member.id === s.id && member.collaborator.name !== s.collaborator.name
(s) => member.id === s.id && member.collaborator[checkAttr] !== s.collaborator[checkAttr]
)
}
}
Expand Down

0 comments on commit 3f3e896

Please sign in to comment.