mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 02:48:51 +00:00
remove adjacent excess Divider (#5680)
* remove adjacent excess 'Divider' * fix upload file tags may cover previous tags
This commit is contained in:
@@ -46,8 +46,10 @@ export default class ListTagPopover extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
updateTags = (repotagList) => {
|
||||
this.setState({ repotagList });
|
||||
updateTags = (newRepotagList) => {
|
||||
this.setState({
|
||||
repotagList: [...this.state.repotagList, ...newRepotagList],
|
||||
});
|
||||
};
|
||||
|
||||
onDeleteTag = (tag) => {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
class RepoTag {
|
||||
constructor(object) {
|
||||
this.id = object.repo_tag_id;
|
||||
this.fileCount = object.files_count;
|
||||
this.fileCount = object.files_count || 0;
|
||||
this.name = object.tag_name;
|
||||
this.color = object.tag_color;
|
||||
}
|
||||
|
@@ -639,6 +639,15 @@ export const Utils = {
|
||||
if (list[list.length - 1] === 'Divider') {
|
||||
list.pop();
|
||||
}
|
||||
|
||||
// Remove adjacent excess 'Divider'
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i] === 'Divider' && list[i + 1] === 'Divider') {
|
||||
list.splice(i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user