From 6136a9b0a1a997ab6fa30ce2692aa017797a4c23 Mon Sep 17 00:00:00 2001 From: Pionxzh Date: Thu, 20 Aug 2026 18:02:07 +0800 Subject: [PATCH] fix: stop idle queues silently on cancel and translate the Cancel button Cancelling an export used to stop() the idle archive/delete queues too, whose done handlers then alerted that conversations were archived and deleted when nothing had happened. A queue now only emits done on stop when it was actually running --- src/locales/en.json | 1 + src/locales/es.json | 1 + src/locales/fr.json | 1 + src/locales/id.json | 1 + src/locales/jp.json | 1 + src/locales/ru.json | 1 + src/locales/tr.json | 1 + src/locales/zh-Hans.json | 1 + src/locales/zh-Hant.json | 1 + src/ui/ExportDialog.tsx | 2 +- src/utils/queue.ts | 6 +++++- 11 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 9a59c97..a540987 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -12,6 +12,7 @@ "Archive": "Archive", "Save": "Save", "Delete": "Delete", + "Cancel": "Cancel", "Select All": "Select All", "Select...": "Select...", "Select Not Exported": "Select Not Exported", diff --git a/src/locales/es.json b/src/locales/es.json index a7ad9dc..5591e5a 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -12,6 +12,7 @@ "Archive": "Archivo", "Save": "Guardar", "Delete": "Borrar", + "Cancel": "Cancelar", "Select All": "Seleccionar Todos", "Select...": "Selección…", "Select Not Exported": "Seleccionar conversaciones no exportadas", diff --git a/src/locales/fr.json b/src/locales/fr.json index 25bdea9..e4f0aff 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -12,6 +12,7 @@ "Archive": "Archiver", "Save": "Enregistrer", "Delete": "Supprimer", + "Cancel": "Annuler", "Select All": "Tout sélectionner", "Select...": "Sélection…", "Select Not Exported": "Sélectionner les conversations non exportées", diff --git a/src/locales/id.json b/src/locales/id.json index 9960e30..a8132fa 100644 --- a/src/locales/id.json +++ b/src/locales/id.json @@ -12,6 +12,7 @@ "Archive": "Arsip", "Save": "Simpan", "Delete": "Hapus", + "Cancel": "Batal", "Select All": "Pilih Semua", "Select...": "Pilih massal…", "Select Not Exported": "Pilih percakapan yang belum diekspor", diff --git a/src/locales/jp.json b/src/locales/jp.json index adaf00a..f0fc18f 100644 --- a/src/locales/jp.json +++ b/src/locales/jp.json @@ -12,6 +12,7 @@ "Archive": "アーカイブ", "Save": "保存", "Delete": "削除", + "Cancel": "キャンセル", "Select All": "すべて選択", "Select...": "一括選択…", "Select Not Exported": "未エクスポートの会話を選択", diff --git a/src/locales/ru.json b/src/locales/ru.json index dab6243..dff7873 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -12,6 +12,7 @@ "Archive": "Архивировать", "Save": "Сохранить", "Delete": "Удалить", + "Cancel": "Отмена", "Select All": "Выбрать все", "Select...": "Выбрать…", "Select Not Exported": "Выбрать неэкспортированные разговоры", diff --git a/src/locales/tr.json b/src/locales/tr.json index 2c80203..b3699ff 100644 --- a/src/locales/tr.json +++ b/src/locales/tr.json @@ -12,6 +12,7 @@ "Archive": "Arşiv", "Save": "Kaydet", "Delete": "Sil", + "Cancel": "İptal", "Select All": "Tümünü Seç", "Select...": "Toplu seçim…", "Select Not Exported": "Dışa aktarılmamış konuşmaları seç", diff --git a/src/locales/zh-Hans.json b/src/locales/zh-Hans.json index d68849b..a208e2d 100644 --- a/src/locales/zh-Hans.json +++ b/src/locales/zh-Hans.json @@ -12,6 +12,7 @@ "Archive": "归档", "Save": "保存", "Delete": "删除", + "Cancel": "取消", "Select All": "全选", "Select...": "批量选择…", "Select Not Exported": "选择未导出的对话", diff --git a/src/locales/zh-Hant.json b/src/locales/zh-Hant.json index bb2e7cd..99aa90b 100644 --- a/src/locales/zh-Hant.json +++ b/src/locales/zh-Hant.json @@ -12,6 +12,7 @@ "Archive": "封存", "Save": "保存", "Delete": "刪除", + "Cancel": "取消", "Select All": "全選", "Select...": "批次選取…", "Select Not Exported": "選取未匯出的對話", diff --git a/src/ui/ExportDialog.tsx b/src/ui/ExportDialog.tsx index e0ca216..e1ef4c9 100644 --- a/src/ui/ExportDialog.tsx +++ b/src/ui/ExportDialog.tsx @@ -834,7 +834,7 @@ const DialogContent: FC = ({ format }) => { title="Stop the export — any batches already downloaded are kept" onClick={cancelExport} > - Cancel + {t('Cancel')}
diff --git a/src/utils/queue.ts b/src/utils/queue.ts index 8d182dc..3bdfbb7 100644 --- a/src/utils/queue.ts +++ b/src/utils/queue.ts @@ -97,8 +97,12 @@ export class RequestQueue { stop() { this.runId++ + const wasRunning = this.status === 'IN_PROGRESS' this.status = 'STOPPED' - this.eventEmitter.emit('done', this.results) + // Only a queue that was actually running reports back — an idle + // queue emitting 'done' makes its listeners announce work (archive/ + // delete alerts) that never happened + if (wasRunning) this.eventEmitter.emit('done', this.results) } clear() {