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 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-08-17 20:27:17 +01:00
parent 4d9fd2c34a
commit 587536bb68
2 changed files with 18 additions and 1 deletions
+7
View File
@@ -613,6 +613,13 @@ var PM = {
setDebug: function (on) { setDebug: function (on) {
document.getElementById('btnWriteTest').hidden = !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 () { showUnlock: function () {
document.body.classList.remove('on-list', 'on-detail', 'searching'); document.body.classList.remove('on-list', 'on-detail', 'searching');
view = 'unlock'; view = 'unlock';
+11 -1
View File
@@ -557,15 +557,25 @@ procedure TForm8.SaveEntryPassword(const ANewValue: string);
var var
LUuid, LTitle: string; LUuid, LTitle: string;
begin 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 if FCurrent.Uuid = '' then
begin begin
WebCall('PM.toast("This entry has no uuid - cannot be updated")'); WebCall('PM.toast("This entry has no uuid - cannot be updated")');
WebCall('PM.editDone()');
Exit; Exit;
end; end;
if FSyncPwd = '' then if FSyncPwd = '' then
begin begin
WebCall('PM.toast("Sync password missing - open the vault first")'); WebCall('PM.toast("Sync password missing - open the vault first")');
WebCall('PM.editDone()');
Exit; Exit;
end; end;
LUuid := FCurrent.Uuid; LUuid := FCurrent.Uuid;