diff --git a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/RoleDropdown.vue b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/RoleDropdown.vue index ba5be30c0f0..68b33532c09 100644 --- a/packages/web-app-files/src/components/SideBar/Shares/Collaborators/RoleDropdown.vue +++ b/packages/web-app-files/src/components/SideBar/Shares/Collaborators/RoleDropdown.vue @@ -157,9 +157,10 @@ export default { return this.allowSharePermission && this.resource.canShare() }, share() { - const userShares = this.sharesTree[this.resource.path]?.filter((s) => - ShareTypes.containsAnyValue(ShareTypes.individuals, [s.shareType]) - ) + // FixMe + const userShares = Object.values(this.sharesTree) + .pop() + ?.filter((s) => ShareTypes.containsAnyValue(ShareTypes.individuals, [s.shareType])) return userShares?.length ? userShares[0] : undefined }, @@ -171,6 +172,8 @@ export default { return SpacePeopleShareRoles.list() } + console.log(this.share) + if (this.resource.isReceivedShare() && this.resourceIsSharable && this.share) { return PeopleShareRoles.filterByBitmask( parseInt(this.share.permissions), diff --git a/packages/web-app-files/src/store/actions.js b/packages/web-app-files/src/store/actions.js index a40adf5832a..c03ad2e124c 100644 --- a/packages/web-app-files/src/store/actions.js +++ b/packages/web-app-files/src/store/actions.js @@ -557,7 +557,7 @@ export default { * This will add new entries into the shares tree and will * not remove unrelated existing ones. */ - loadSharesTree(context, { client, path, storageId }) { + async loadSharesTree(context, { client, path, storageId }) { context.commit('SHARESTREE_ERROR', null) // prune shares tree cache for all unrelated paths, keeping only // existing relevant parent entries @@ -566,15 +566,7 @@ export default { const parentPaths = getParentPaths(path, true) const sharesTree = {} - if (!parentPaths.length) { - return Promise.resolve() - } - - // remove last entry which is the root folder - parentPaths.pop() - context.commit('SHARESTREE_LOADING', true) - const shareQueriesQueue = new PQueue({ concurrency: 2 }) const shareQueriesPromises = [] parentPaths.forEach((queryPath) => {