From 587536bb68a54934918728fceba5b8077dbd6771 Mon Sep 17 00:00:00 2001 From: r-zakarya <82443831+r-zakarya@users.noreply.github.com> Date: Mon, 17 Aug 2026 20:27:17 +0100 Subject: [PATCH] fix(android): every refusal hands the screen back Reported together, and the second explains the first: Cancel did nothing because Save disables it and nothing re-enabled it - a disabled button fires no click. And the screen never came back because the entry guards (busy, no uuid, no sync password) returned with a toast and nothing else, leaving the editor open with every control dead. A cul-de-sac with no way out but killing the app. Each guard now calls PM.editDone, which redraws the row from the last detail received. The page can leave edit mode without asking Delphi for anything, which is what it needed to recover from a refusal that never reached the network. Co-Authored-By: Claude Opus 5 --- android-client/web/app.html | 7 +++++++ mainApk.pas | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/android-client/web/app.html b/android-client/web/app.html index 92e2730..c1018b8 100644 --- a/android-client/web/app.html +++ b/android-client/web/app.html @@ -613,6 +613,13 @@ var PM = { setDebug: function (on) { document.getElementById('btnWriteTest').hidden = !on; }, + /// Sort du mode edition sans rien demander a Delphi. Sert aux refus + /// immediats : l'editeur y restait ouvert, boutons desactives, et Cancel + /// lui-meme ne repondait plus. + editDone: function () { + if (lastDetail) renderDetail(lastDetail); + }, + showUnlock: function () { document.body.classList.remove('on-list', 'on-detail', 'searching'); view = 'unlock'; diff --git a/mainApk.pas b/mainApk.pas index 9ee6fb5..ddb1aba 100644 --- a/mainApk.pas +++ b/mainApk.pas @@ -557,15 +557,25 @@ procedure TForm8.SaveEntryPassword(const ANewValue: string); var LUuid, LTitle: string; begin - if FBusy then Exit; + // CHAQUE REFUS REND LA MAIN A LA PAGE. Ces gardes se contentaient d'un + // message : l'editeur restait ouvert avec ses boutons desactives, donc + // Cancel lui-meme ne repondait plus - un cul-de-sac dont rien ne sortait. + if FBusy then + begin + WebCall('PM.toast("Busy - wait for the current operation")'); + WebCall('PM.editDone()'); + Exit; + end; if FCurrent.Uuid = '' then begin WebCall('PM.toast("This entry has no uuid - cannot be updated")'); + WebCall('PM.editDone()'); Exit; end; if FSyncPwd = '' then begin WebCall('PM.toast("Sync password missing - open the vault first")'); + WebCall('PM.editDone()'); Exit; end; LUuid := FCurrent.Uuid;