mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
fix(operation) next current file after delete
This commit is contained in:
parent
ae468b4de5
commit
aacb1af6b5
1 changed files with 10 additions and 12 deletions
|
|
@ -263,20 +263,18 @@ function deleteSilent(files = DOM.getActiveFiles()) {
|
|||
|
||||
const removedNames = DOM.getFilenames(files);
|
||||
const names = DOM.CurrentInfo.files.map(DOM.getCurrentName);
|
||||
const prevCurrent = DOM.getCurrentName();
|
||||
const currentName = getNextCurrentName(prevCurrent, names, removedNames);
|
||||
const currentName = DOM.getCurrentName();
|
||||
const nextCurrentName = getNextCurrentName(currentName, names, removedNames);
|
||||
|
||||
deleteFn(path + query, removedNames, (e) => {
|
||||
const Storage = DOM.Storage;
|
||||
const dirPath = Info.dirPath;
|
||||
|
||||
DOM.setCurrentByName(prevCurrent);
|
||||
|
||||
!e && CloudCmd.refresh({
|
||||
currentName
|
||||
deleteFn(path + query, removedNames, () => {
|
||||
CloudCmd.refresh(() => {
|
||||
const names = Info.files.map(DOM.getCurrentName);
|
||||
const isCurrent = names.includes(currentName);
|
||||
|
||||
let name = isCurrent ? currentName : nextCurrentName;
|
||||
|
||||
DOM.setCurrentByName(name);
|
||||
});
|
||||
|
||||
Storage.removeMatch(dirPath);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue