Skip to content

Hide show more btn in file-tree list if no more data #24983

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

Closed
wants to merge 4 commits into from
Closed
Changes from 2 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
2 changes: 2 additions & 0 deletions web_src/js/components/DiffFileTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default {
// Merge folders with just a folder as children in order to
// reduce the depth of our tree.
mergeChildIfOnlyOneDir(result);
this.isIncomplete = pageData.diffFileInfo.isIncomplete;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not change value in a computed function. It breaks the reactive system

Copy link
Member

Choose a reason for hiding this comment

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

Is it a use case for a store?

Copy link
Contributor

@wxiaoguang wxiaoguang May 29, 2023

Choose a reason for hiding this comment

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

Yup (not sure how to answer by yes or no, so see details)

For best practice: https://vuejs.org/guide/essentials/computed.html#best-practices

For "store": I think the page data should be passed by a store, this diff page has been broken for many times.

return result;
}
},
Expand Down Expand Up @@ -147,6 +148,7 @@ export default {
this.isLoadingNewData = false;
const {pageData} = window.config;
this.diffEnd = pageData.diffFileInfo.diffEnd;
this.isIncomplete = pageData.diffFileInfo.isIncomplete;
});
},
},
Expand Down