From 8a769fd5124f5bd4fdd6420e16dc7c38b031cd1c Mon Sep 17 00:00:00 2001 From: coderiaser Date: Tue, 20 Jan 2026 19:05:41 +0200 Subject: [PATCH] fix: client: modules: operation: no update after copy --- client/modules/operation/index.mjs | 2 +- .../{set-listeners.js => set-listeners.mjs} | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) rename client/modules/operation/{set-listeners.js => set-listeners.mjs} (86%) diff --git a/client/modules/operation/index.mjs b/client/modules/operation/index.mjs index 555433f6..48b6fa02 100644 --- a/client/modules/operation/index.mjs +++ b/client/modules/operation/index.mjs @@ -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; diff --git a/client/modules/operation/set-listeners.js b/client/modules/operation/set-listeners.mjs similarity index 86% rename from client/modules/operation/set-listeners.js rename to client/modules/operation/set-listeners.mjs index 495cd04b..f9785ca2 100644 --- a/client/modules/operation/set-listeners.js +++ b/client/modules/operation/set-listeners.mjs @@ -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(); },