mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
feature: cloudcmd: operation: rm useless checks
This commit is contained in:
parent
36bacfe915
commit
a9bc22ce29
1 changed files with 1 additions and 10 deletions
|
|
@ -15,15 +15,12 @@ export const setListeners = (options) => (emitter) => {
|
|||
} = options;
|
||||
|
||||
let done;
|
||||
let lastError;
|
||||
|
||||
const onAbort = wraptile(({emitter, operation}) => {
|
||||
emitter.abort();
|
||||
|
||||
const msg = `${operation} aborted`;
|
||||
|
||||
lastError = true;
|
||||
|
||||
Dialog.alert(msg, {
|
||||
cancel: false,
|
||||
});
|
||||
|
|
@ -40,13 +37,10 @@ export const setListeners = (options) => (emitter) => {
|
|||
operation,
|
||||
}));
|
||||
|
||||
let noProgress = true;
|
||||
|
||||
const listeners = {
|
||||
progress: (value) => {
|
||||
done = value === 100;
|
||||
progress.setProgress(value);
|
||||
noProgress = false;
|
||||
},
|
||||
|
||||
end: () => {
|
||||
|
|
@ -54,13 +48,10 @@ export const setListeners = (options) => (emitter) => {
|
|||
forEachKey(removeListener, listeners);
|
||||
progress.remove();
|
||||
|
||||
if (lastError || done || noProgress)
|
||||
callback();
|
||||
callback();
|
||||
},
|
||||
|
||||
error: async (error) => {
|
||||
lastError = error;
|
||||
|
||||
if (noContinue) {
|
||||
listeners.end(error);
|
||||
Dialog.alert(error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue