fix(android): a refusal always hands control back
The form disables its Save button on send, so a refusal that only speaks leaves it dead with the typed text behind it - which is what happened to the one guard added with entry creation: name it, press Save, nothing. The rule had already been forgotten twice before, at the editor. It is a procedure now rather than two calls side by side, because two calls side by side is exactly what gets written as one. Measured on the device: refuse, let the message fade, refuse again - the second press produces the message, so the button had come back.
This commit is contained in:
+16
-7
@@ -204,6 +204,7 @@ type
|
||||
procedure PatchSelfCheck;
|
||||
{$ENDIF}
|
||||
procedure OpenEntry(AVaultIndex: Integer);
|
||||
procedure RefuseChange(const AMessage: string);
|
||||
procedure CommitChange(const ALabel, AComment, AReopenUuid: string;
|
||||
const APatch: TFunc<string, string>);
|
||||
procedure SaveEntryPassword(const ANewValue: string);
|
||||
@@ -606,6 +607,17 @@ end;
|
||||
/// tout - y compris le dechiffrement, parce que le contenu a change. Trois
|
||||
/// essais : au-dela, c'est que l'autre appareil publie en boucle, et insister
|
||||
/// n'y changerait rien.
|
||||
/// REFUSER, ET RENDRE LA MAIN. Les deux, toujours, et c'est pour cela que ca
|
||||
/// tient en une procedure plutot qu'en deux appels cote a cote : la page
|
||||
/// desactive son bouton en envoyant, donc un refus qui se contente de parler
|
||||
/// laisse un formulaire mort avec la saisie derriere. La regle s'est deja fait
|
||||
/// oublier trois fois - a l'editeur, puis au formulaire de creation.
|
||||
procedure TForm8.RefuseChange(const AMessage: string);
|
||||
begin
|
||||
WebCall('PM.toast(' + JsArg(AMessage) + ')');
|
||||
WebCall('PM.editDone()');
|
||||
end;
|
||||
|
||||
/// ENREGISTRER UNE MODIFICATION - un seul chemin, deux transports.
|
||||
///
|
||||
/// La regle qui tranche : SI UN CONTENEUR LOCAL EXISTE, C'EST LUI L'AUTORITE.
|
||||
@@ -626,14 +638,12 @@ begin
|
||||
// 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()');
|
||||
RefuseChange('Busy - wait for the current operation');
|
||||
Exit;
|
||||
end;
|
||||
if FSyncPwd = '' then
|
||||
begin
|
||||
WebCall('PM.toast("Master password missing - open the vault first")');
|
||||
WebCall('PM.editDone()');
|
||||
RefuseChange('Master password missing - open the vault first');
|
||||
Exit;
|
||||
end;
|
||||
SetBusy(True);
|
||||
@@ -792,8 +802,7 @@ var
|
||||
begin
|
||||
if FCurrent.Uuid = '' then
|
||||
begin
|
||||
WebCall('PM.toast("This entry has no uuid - cannot be updated")');
|
||||
WebCall('PM.editDone()');
|
||||
RefuseChange('This entry has no uuid - cannot be updated');
|
||||
Exit;
|
||||
end;
|
||||
LUuid := FCurrent.Uuid;
|
||||
@@ -811,7 +820,7 @@ begin
|
||||
// liste, et rien ne permettrait de la retrouver pour la corriger.
|
||||
if (ATitle = '') and (ASite = '') and (AUser = '') then
|
||||
begin
|
||||
WebCall('PM.toast("Give it at least a name")');
|
||||
RefuseChange('Give it at least a name');
|
||||
Exit;
|
||||
end;
|
||||
CommitChange('Added: ' + ATitle, 'new entry from phone', '',
|
||||
|
||||
Reference in New Issue
Block a user