mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 10:58:33 +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) => {
|
updateTags = (newRepotagList) => {
|
||||||
this.setState({ repotagList });
|
this.setState({
|
||||||
|
repotagList: [...this.state.repotagList, ...newRepotagList],
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onDeleteTag = (tag) => {
|
onDeleteTag = (tag) => {
|
||||||
|
@@ -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;
|
||||||
}
|
}
|
||||||
|
@@ -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;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user