refactor(client) refresh: promisify

This commit is contained in:
coderaiser 2019-05-17 19:19:51 +03:00
parent 9ff5982a5b
commit 1b174d5f2f
3 changed files with 13 additions and 12 deletions

View file

@ -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);
});
}

View file

@ -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();