1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-05-11 17:34:56 +00:00

fix selection state error after copy items ()

* fix selection state error after copy items

* optimize

---------

Co-authored-by: zhouwenxuan <aries@Mac.local>
This commit is contained in:
Aries 2025-02-19 14:55:01 +08:00 committed by GitHub
parent d9019be22f
commit 659ada62d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -820,6 +820,7 @@ class LibContentView extends React.Component {
let dirNames = this.getSelectedDirentNames();
seafileAPI.copyDir(repoID, destRepo.repo_id, destDirentPath, this.state.path, dirNames).then(res => {
this.onSelectedDirentListUpdate([]);
if (repoID !== destRepo.repo_id) {
this.setState({
asyncCopyMoveTaskId: res.data.task_id,
@ -1315,6 +1316,7 @@ class LibContentView extends React.Component {
};
copyItemsAjaxCallback = (repoID, targetRepo, dirent, copyToDirentPath, nodeParentPath, taskId, byDialog = false) => {
this.onSelectedDirentListUpdate([]);
if (repoID !== targetRepo.repo_id) {
this.setState({
asyncCopyMoveTaskId: taskId,
@ -1495,6 +1497,7 @@ class LibContentView extends React.Component {
isDirentSelected: newSelectedDirentList.length > 0,
selectedDirentList: newSelectedDirentList,
lastSelectedIndex: lastSelectedIndex,
isAllDirentSelected: newSelectedDirentList.length === this.state.direntList.length,
});
};