mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-08-04 21:53:14 +00:00
refactor(client) refresh: promisify
This commit is contained in:
parent
9ff5982a5b
commit
1b174d5f2f
3 changed files with 13 additions and 12 deletions
|
|
@ -319,15 +319,15 @@ function deleteSilent(files = DOM.getActiveFiles()) {
|
|||
const currentName = DOM.getCurrentName();
|
||||
const nextCurrentName = getNextCurrentName(currentName, names, removedNames);
|
||||
|
||||
deleteFn(path + query, removedNames, () => {
|
||||
CloudCmd.refresh(() => {
|
||||
const names = Info.files.map(DOM.getCurrentName);
|
||||
const isCurrent = names.includes(currentName);
|
||||
|
||||
const name = isCurrent ? currentName : nextCurrentName;
|
||||
|
||||
DOM.setCurrentByName(name);
|
||||
});
|
||||
deleteFn(path + query, removedNames, async () => {
|
||||
await CloudCmd.refresh();
|
||||
|
||||
const names = Info.files.map(DOM.getCurrentName);
|
||||
const isCurrent = names.includes(currentName);
|
||||
|
||||
const name = isCurrent ? currentName : nextCurrentName;
|
||||
|
||||
DOM.setCurrentByName(name);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ module.exports = {
|
|||
if (e)
|
||||
return Dialog.alert(e);
|
||||
|
||||
await tryToPromisify(CloudCmd.refresh);
|
||||
await CloudCmd.refresh();
|
||||
DOM.setCurrentByName('.cloudcmd.menu.js');
|
||||
|
||||
await CloudCmd.EditFile.show();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue