-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
perf: render sharing tab sections only once #54413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
358ac7a to
cb0e8e8
Compare
cb0e8e8 to
9d5819b
Compare
| <component :is="section($refs['section-'+index], fileInfo)" :file-info="fileInfo" /> | ||
| <component :is="component" :file-info="fileInfo" /> |
There was a problem hiding this comment.
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.
szaimen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, saw it working on Richards PC in the related resources app and group folders app :)
Signed-off-by: Richard Steinmetz <[email protected]>
d6bd320 to
798f373
Compare
skjnldsv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code make sense, nice catch
Summary
Before: Related resources are loaded twice each time the sharing sidebar is open.
After: Is only loaded once.
I noticed that the first parameter of the section callback (el) is always undefined. This has been the case since January and it is not used inside any app in the Nextcloud org.
Checklist