From 3fc8c6992be4767a6b89bbfd48769bddcb3ea88e Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Sun, 18 Oct 2026 10:49:58 +0000 Subject: [PATCH] desktop: don't hand an open Save dialog to another file Some save requests open the Save dialog only after a wait: a file opened when its download finishes, a file fetched from a linked mobile, the database export. If a Save dialog was already open for another file, such a request replaced the first one's result: the open dialog, still showing the first file's name, saved the second file's content under it, and the first request never completed. A save request while a Save dialog is open now completes as cancelled. The chooser is modal, so only a delayed request can arrive meanwhile. --- .../kotlin/chat/simplex/common/platform/Files.desktop.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/Files.desktop.kt b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/Files.desktop.kt index b779954efc..48702fecac 100644 --- a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/Files.desktop.kt +++ b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/Files.desktop.kt @@ -75,6 +75,7 @@ actual class FileChooserLauncher actual constructor() { ) res = simplexWindowState.openDialog.awaitResult(params) } else { + if (simplexWindowState.saveDialog.isAwaiting) return onResult(null) res = simplexWindowState.saveDialog.awaitResult(DialogParams(filename = input)) if (res != null && res.isDirectory) { res = File(res, input)