Skip to content
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

Set fileInfo correctly for LegacyTabs #20564

Merged
merged 1 commit into from
Apr 21, 2020
Merged

Conversation

go2sh
Copy link
Contributor

@go2sh go2sh commented Apr 19, 2020

Watch for changes of the fileInfo prop and propagate it to the underlying component.

Fixes #20106.

Watch for changes of the fileInfo prop and propagate it to,
the underlying component.

Fixes nextcloud#20106.

Signed-off-by: Christoph Seitz <christoph.seitz@posteo.de>
@kesselb kesselb requested a review from skjnldsv April 20, 2020 07:13
@kesselb kesselb added 3. to review Waiting for reviews bug feature: file sidebar Related to the file sidebar component labels Apr 20, 2020
@kesselb kesselb added this to the Nextcloud 19 milestone Apr 20, 2020
activeTab(activeTab) {
if (activeTab === this.id && this.fileInfo) {
this.setFileInfo(this.fileInfo)
fileInfo(fileInfo) {
Copy link
Member

Choose a reason for hiding this comment

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

It means every time the fileinfo changes, all the tabs gets reloaded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'am not sure, what you mean. The fileInfo is set once through the open method of the sidebar. (triggered through the Details click in the action list). Each tab get the fileInfo as prop from the sidebar. My change is just here to propagate the change to the component of the legacytab. Currently the fileInfo in the legacy component is only updates on the first load of the sidebar or when you change the tab back and forth (see the if clause). To fix the bug mentioned it needs to propagate every time the prop changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you want to prevent loading data in the background, I could leave both. The activeTab watch for changing tabs and the fileInfo if it is the activeTab. But I think there is no drawback of loading every thing at once as it makes switching tabs more seamless.

Copy link
Member

Choose a reason for hiding this comment

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

No, I guess it's fine :)
I was concerned about the legacy tabs, but the vue ones should be smart enough to only refresh what is needed, so it's fine!
We'll kill the old tabs eventually! 👍

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Code looks good 👍

@MorrisJobke MorrisJobke merged commit 89bd8ea into nextcloud:master Apr 21, 2020
@MorrisJobke
Copy link
Member

@skjnldsv @go2sh Backport to 18?

@go2sh
Copy link
Contributor Author

go2sh commented Apr 21, 2020

Yes, please. The bug is also present in 18 at least.

@rullzer rullzer mentioned this pull request Apr 21, 2020
55 tasks
@MorrisJobke
Copy link
Member

/backport to stable18

@backportbot-nextcloud
Copy link

backport to stable18 in #20588 with conflicts ⚠️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug feature: file sidebar Related to the file sidebar component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Files sidebar: Activity tab not updating on file switch
4 participants