Skip to content

Commit 8a769fd

Browse files
committed
fix: client: modules: operation: no update after copy
1 parent 3b40907 commit 8a769fd

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

client/modules/operation/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import load from 'load.js';
66
import {tryToCatch} from 'try-to-catch';
77
import {encode} from '../../../common/entity.js';
88
import removeExtension from './remove-extension.js';
9-
import setListeners from './set-listeners.js';
9+
import {setListeners} from './set-listeners.mjs';
1010
import getNextCurrentName from './get-next-current-name.js';
1111

1212
const {DOM, CloudCmd} = globalThis;

client/modules/operation/set-listeners.js renamed to client/modules/operation/set-listeners.mjs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
'use strict';
2-
31
/* global DOM */
4-
const forEachKey = require('for-each-key');
5-
6-
const wraptile = require('wraptile');
7-
const format = require('./format');
2+
import forEachKey from 'for-each-key';
3+
import wraptile from 'wraptile';
4+
import format from './format.js';
85

96
const {Dialog, Images} = DOM;
107

11-
module.exports = (options) => (emitter) => {
8+
export const setListeners = (options) => (emitter) => {
129
const {
1310
operation,
1411
callback,
@@ -43,18 +40,20 @@ module.exports = (options) => (emitter) => {
4340
operation,
4441
}));
4542

43+
let noProgress = true;
4644
const listeners = {
4745
progress: (value) => {
4846
done = value === 100;
4947
progress.setProgress(value);
48+
noProgress = false;
5049
},
5150

5251
end: () => {
5352
Images.hide();
5453
forEachKey(removeListener, listeners);
5554
progress.remove();
5655

57-
if (lastError || done)
56+
if (lastError || done || noProgress)
5857
callback();
5958
},
6059

0 commit comments

Comments
 (0)