diff --git a/frontend/src/components/dialog/clean-trash.js b/frontend/src/components/dialog/clean-trash.js index e290390597b..fa3fb46dee4 100644 --- a/frontend/src/components/dialog/clean-trash.js +++ b/frontend/src/components/dialog/clean-trash.js @@ -44,6 +44,14 @@ class CleanTrash extends React.Component { submitBtnDisabled: true }); seafileAPI.deleteRepoTrash(repoID, inputValue.value).then((res) => { + if (this.props.trashType === 0) { + this.props.refreshTrash2(); + } + if (this.props.trashType === 1) { + this.props.refreshTrash(); + } + this.props.toggleDialog(); + toaster.success(gettext('Clean succeeded.')); }).catch((error) => { let errorMsg = Utils.getErrorMsg(error); this.setState({ @@ -52,14 +60,6 @@ class CleanTrash extends React.Component { }); }); - if (this.props.trashType === 0){ - this.props.refreshTrash2(); - } - if (this.props.trashType === 1){ - this.props.refreshTrash(); - } - this.props.toggleDialog(); - toaster.success(gettext('Clean succeeded.')); }; render() { diff --git a/frontend/src/components/dialog/select-trash.js b/frontend/src/components/dialog/select-trash.js index 3cb5b7e67ff..78048aa661a 100644 --- a/frontend/src/components/dialog/select-trash.js +++ b/frontend/src/components/dialog/select-trash.js @@ -35,19 +35,20 @@ class SelectTrash extends React.Component { formSubmit = ()=>{ const inputValue = this.state.inputValue; if (inputValue.value === 1){ - this.OldTrash(); + this.listOldTrash(); } if (inputValue.value === 0){ - this.NewTrash(); + this.listNewTrash(); } this.props.changeTrash(this.state.inputValue.value); }; - OldTrash = ()=>{ + listOldTrash = ()=>{ this.props.refreshTrash(); this.props.toggleDialog(); }; - NewTrash = () => { + + listNewTrash = () => { this.props.refreshTrash2(); this.props.toggleDialog(); }; @@ -55,10 +56,9 @@ class SelectTrash extends React.Component { render() { return ( - {gettext('Old Trash')} + {gettext('Select trash')} -

{gettext('Select Trash')}

{gettext('Current path: ')}{showFolder ? this.renderFolderPath() : {repoFolderName}}

- - - {(path == '/' && enableClean && !showFolder && isRepoAdmin) && - - - } +
+ + {(path == '/' && enableClean && !showFolder && isRepoAdmin) && + + } +