Skip to content

Commit

Permalink
Merge pull request #32594 from nextcloud/fix/groupfolder-not-loading-…
Browse files Browse the repository at this point in the history
…when-share-disabled

Fix loading groupfolder info when share api is disabled
  • Loading branch information
CarlSchwan authored May 27, 2022
2 parents e4378fd + 581e13a commit ec96aa5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
30 changes: 20 additions & 10 deletions apps/files_sharing/src/views/SharingTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<template>
<div :class="{ 'icon-loading': loading }">
<!-- error message -->
<div v-if="error" class="emptycontent">
<div v-if="error" class="emptycontent" :class="{ emptyContentWithSections: sections.length > 0 }">
<div class="icon icon-error" />
<h2>{{ error }}</h2>
</div>
Expand Down Expand Up @@ -73,15 +73,15 @@
:id="`${fileInfo.id}`"
type="file"
:name="fileInfo.name" />

<!-- additionnal entries, use it with cautious -->
<div v-for="(section, index) in sections"
:ref="'section-' + index"
:key="index"
class="sharingTab__additionalContent">
<component :is="section($refs['section-'+index], fileInfo)" :file-info="fileInfo" />
</div>
</template>

<!-- additionnal entries, use it with cautious -->
<div v-for="(section, index) in sections"
:ref="'section-' + index"
:key="index"
class="sharingTab__additionalContent">
<component :is="section($refs['section-'+index], fileInfo)" :file-info="fileInfo" />
</div>
</div>
</template>

Expand Down Expand Up @@ -204,7 +204,11 @@ export default {
this.processSharedWithMe(sharedWithMe)
this.processShares(shares)
} catch (error) {
this.error = t('files_sharing', 'Unable to load the shares list')
if (error.response.data?.ocs?.meta?.message) {
this.error = error.response.data.ocs.meta.message
} else {
this.error = t('files_sharing', 'Unable to load the shares list')
}
this.loading = false
console.error('Error loading the shares list', error)
}
Expand Down Expand Up @@ -353,3 +357,9 @@ export default {
},
}
</script>
<style scoped lang="scss">
.emptyContentWithSections {
margin: 1rem auto;
}
</style>
4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

0 comments on commit ec96aa5

Please sign in to comment.