1
0
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:
Michael An
2023-10-11 20:40:16 +08:00
committed by GitHub
parent 7c6e2bf032
commit d4445fad51
3 changed files with 14 additions and 3 deletions

View File

@@ -46,8 +46,10 @@ export default class ListTagPopover extends React.Component {
}); });
}; };
updateTags = (repotagList) => { updateTags = (newRepotagList) => {
this.setState({ repotagList }); this.setState({
repotagList: [...this.state.repotagList, ...newRepotagList],
});
}; };
onDeleteTag = (tag) => { onDeleteTag = (tag) => {

View File

@@ -1,7 +1,7 @@
class RepoTag { class RepoTag {
constructor(object) { constructor(object) {
this.id = object.repo_tag_id; this.id = object.repo_tag_id;
this.fileCount = object.files_count; this.fileCount = object.files_count || 0;
this.name = object.tag_name; this.name = object.tag_name;
this.color = object.tag_color; this.color = object.tag_color;
} }

View File

@@ -639,6 +639,15 @@ export const Utils = {
if (list[list.length - 1] === 'Divider') { if (list[list.length - 1] === 'Divider') {
list.pop(); 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; return list;
}, },