Skip to content

Commit 5d7ab2a

Browse files
fix(mobile): iOS no longer offers to save a secret card as a login
An email field beside a masked field looks like a sign-in form, so iOS offered to save the password to Keychain when the card closed. The card now empties its fields as it saves and puts them back if the save fails. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent fef80bc commit 5d7ab2a

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎apps/mobile/src/features/threads/SecretRequestCard.tsx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,15 @@ function PendingSecretRequestForm(props: {
8686
inFlight.current = true;
8787
setSubmitting(true);
8888
setError(null);
89+
// iOS offers to save a masked field that leaves the screen with text in it as a login
90+
// password, so the card is emptied before it closes; a failed save puts the values back.
91+
if (reply.type === "save") setValues({});
8992
const result = await answer({ environmentId: props.environmentId, input }).finally(() => {
9093
inFlight.current = false;
9194
setSubmitting(false);
9295
});
93-
if (result._tag === "Success") {
94-
setValues({});
95-
return;
96-
}
96+
if (result._tag === "Success") return;
97+
if (reply.type === "save") setValues(reply.values);
9798
if (!isAtomCommandInterrupted(result)) {
9899
pipe(squashAtomCommandFailure(result), secretRequestFailureMessage, setError);
99100
}

0 commit comments

Comments
 (0)