mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
Improve/move dirent dialog UI (#6786)
* update move dialog and search input * update move dialog ui * clean up code * update code --------- Co-authored-by: renjie-run <rj.aiyayao@gmail.com>
This commit is contained in:
@@ -938,6 +938,8 @@ class LibContentView extends React.Component {
|
||||
|
||||
this.deleteDirents(dirNames);
|
||||
|
||||
this.removeFromRecentlyUsed(repoID, this.state.path);
|
||||
|
||||
let msg = '';
|
||||
if (direntPaths.length > 1) {
|
||||
msg = gettext('Successfully deleted {name} and {n} other items.');
|
||||
@@ -965,6 +967,14 @@ class LibContentView extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
removeFromRecentlyUsed = (repoID, path) => {
|
||||
const recentlyUsed = JSON.parse(localStorage.getItem('recently-used-list')) || [];
|
||||
const updatedRecentlyUsed = recentlyUsed.filter(item =>
|
||||
!(item.repo.repo_id === repoID && item.path === path)
|
||||
);
|
||||
localStorage.setItem('recently-used-list', JSON.stringify(updatedRecentlyUsed));
|
||||
};
|
||||
|
||||
onAddFolder = (dirPath) => {
|
||||
let repoID = this.props.repoID;
|
||||
seafileAPI.createDir(repoID, dirPath).then(() => {
|
||||
@@ -1237,6 +1247,7 @@ class LibContentView extends React.Component {
|
||||
this.deleteTreeNode(path);
|
||||
}
|
||||
this.deleteDirent(path);
|
||||
this.removeFromRecentlyUsed(this.props.repoID, path);
|
||||
}
|
||||
|
||||
// list operations
|
||||
|
Reference in New Issue
Block a user