mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix: client: modules: operation: no update after copy
This commit is contained in:
parent
3b409074c1
commit
8a769fd512
2 changed files with 8 additions and 9 deletions
|
|
@ -6,7 +6,7 @@ import load from 'load.js';
|
|||
import {tryToCatch} from 'try-to-catch';
|
||||
import {encode} from '../../../common/entity.js';
|
||||
import removeExtension from './remove-extension.js';
|
||||
import setListeners from './set-listeners.js';
|
||||
import {setListeners} from './set-listeners.mjs';
|
||||
import getNextCurrentName from './get-next-current-name.js';
|
||||
|
||||
const {DOM, CloudCmd} = globalThis;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
'use strict';
|
||||
|
||||
/* global DOM */
|
||||
const forEachKey = require('for-each-key');
|
||||
|
||||
const wraptile = require('wraptile');
|
||||
const format = require('./format');
|
||||
import forEachKey from 'for-each-key';
|
||||
import wraptile from 'wraptile';
|
||||
import format from './format.js';
|
||||
|
||||
const {Dialog, Images} = DOM;
|
||||
|
||||
module.exports = (options) => (emitter) => {
|
||||
export const setListeners = (options) => (emitter) => {
|
||||
const {
|
||||
operation,
|
||||
callback,
|
||||
|
|
@ -43,10 +40,12 @@ module.exports = (options) => (emitter) => {
|
|||
operation,
|
||||
}));
|
||||
|
||||
let noProgress = true;
|
||||
const listeners = {
|
||||
progress: (value) => {
|
||||
done = value === 100;
|
||||
progress.setProgress(value);
|
||||
noProgress = false;
|
||||
},
|
||||
|
||||
end: () => {
|
||||
|
|
@ -54,7 +53,7 @@ module.exports = (options) => (emitter) => {
|
|||
forEachKey(removeListener, listeners);
|
||||
progress.remove();
|
||||
|
||||
if (lastError || done)
|
||||
if (lastError || done || noProgress)
|
||||
callback();
|
||||
},
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue