Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apps/files_sharing/src/services/TabSections.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

/**
* Callback to render a section in the sharing tab.
*
* @callback registerSectionCallback
* @param {undefined} el - Deprecated and will always be undefined (formerly the root element)
* @param {object} fileInfo - File info object
*/

export default class TabSections {

_sections
Expand Down
9 changes: 6 additions & 3 deletions apps/files_sharing/src/views/SharingTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,10 @@
</NcPopover>
</div>
<!-- additional entries, use it with cautious -->
<div v-for="(section, index) in sections"
:ref="'section-' + index"
<div v-for="(component, index) in sectionComponents"
:key="index"
class="sharingTab__additionalContent">
<component :is="section($refs['section-'+index], fileInfo)" :file-info="fileInfo" />
<component :is="component" :file-info="fileInfo" />
Comment on lines -134 to +133
Copy link
Member Author

@st3iny st3iny Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem was here. The section callback was executed twice during render. Now it is cached via a computed property.

</div>

<!-- projects (deprecated as of NC25 (replaced by related_resources) - see instance config "projects.enabled" ; ignore this / remove it / move into own section) -->
Expand Down Expand Up @@ -286,6 +285,10 @@ export default {
// TRANSLATORS: Type as in with a keyboard
: t('files_sharing', 'Type an email or federated cloud ID')
},

sectionComponents() {
return this.sections.map((section) => section(undefined, this.fileInfo))
},
},
methods: {
/**
Expand Down
2 changes: 2 additions & 0 deletions dist/6348-6348.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/6348-6348.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/6348-6348.js.map.license
2 changes: 0 additions & 2 deletions dist/7639-7639.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/7639-7639.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/7639-7639.js.map.license

This file was deleted.

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.

Loading