diff --git a/frontend/src/components/dialog/list-taggedfiles-dialog.js b/frontend/src/components/dialog/list-taggedfiles-dialog.js index 940346c1ee..4912d800f4 100644 --- a/frontend/src/components/dialog/list-taggedfiles-dialog.js +++ b/frontend/src/components/dialog/list-taggedfiles-dialog.js @@ -12,6 +12,7 @@ const propTypes = { toggleCancel: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired, updateUsedRepoTags: PropTypes.func.isRequired, + onFileTagChanged: PropTypes.func, }; class ListTaggedFilesDialog extends React.Component { @@ -23,12 +24,20 @@ class ListTaggedFilesDialog extends React.Component { }; } + onFileTagChanged = (TaggedFile) => { + const path = TaggedFile.parent_path; + const dirent = {name: TaggedFile.filename}; + let direntPath = path === '/' ? path + TaggedFile.filename : path + '/' + TaggedFile.filename; + this.props.onFileTagChanged(dirent, direntPath); + } + onDeleteTaggedFile = (taggedFile) => { let repoID = this.props.repoID; let fileTagID = taggedFile.file_tag_id; seafileAPI.deleteFileTag(repoID, fileTagID).then(res => { this.getTaggedFiles(); this.props.updateUsedRepoTags(); + if (this.props.onFileTagChanged) this.onFileTagChanged(taggedFile); }); } diff --git a/frontend/src/components/dir-view-mode/dir-list-view.js b/frontend/src/components/dir-view-mode/dir-list-view.js index 4a298a12b5..174223fabf 100644 --- a/frontend/src/components/dir-view-mode/dir-list-view.js +++ b/frontend/src/components/dir-view-mode/dir-list-view.js @@ -64,6 +64,7 @@ class DirListView extends React.Component { draftCounts={this.props.draftCounts} usedRepoTags={this.props.usedRepoTags} updateUsedRepoTags={this.props.updateUsedRepoTags} + onFileTagChanged={this.props.onFileTagChanged} /> )} )}