fix: SMS MFA masked number and launch button idle spinner#1108
Merged
Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small fixes in the auth + connection UI.
1. SMS 2FA prompt rendering
{{number}}literallyThe verification message at
MFACode.tsx:109calledt()without passing thenumberinterpolation variable, so i18next left the placeholder text untouched. Now pulls the masked destination from Cognito'schallengeParam.CODE_DELIVERY_DESTINATION, extracts the last 4 digits, and renders it as(ending in 1234). Falls back cleanly when the destination is missing — no double space, no dangling parens.frontend/src/cognito/types.d.ts— widenedchallengeParamto expose the optionalCODE_DELIVERY_DESTINATION.frontend/src/cognito/components/MFACode/MFACode.tsx— added aformatMaskedDestinationhelper and passed its result as thenumbervariable.frontend/src/cognito/locales/en/translations.json— tightened placeholder positioning so the helper-supplied leading space (or empty string) reads correctly either way.2. Launch button stuck in loading state for idle on-demand connections
PR #1102 changed
readyto requireconnection.connected, so the auto-launch effect wouldn't fire until the tunnel was live. Butreadyis also the input to theloadingflag — meaning idle/on-demand services (ready: true, connected: false) now permanently rendered the spinner.Split the two concerns:
readykeeps its old meaning (gates the loading spinner / click-enable), and a newconnectedpredicate gates only the auto-launchuseEffect.connectLinkservices continue to be treated as both ready and connected.frontend/src/buttons/LaunchButton/LaunchButton.tsxTest plan
…mobile device (ending in 1234). This code…CODE_DELIVERY_DESTINATIONand confirm the prompt reads…mobile device. This code…with no double spaceconnectedbefore opening the browser (PR fix(launch): wait for connected state before auto-launching browser #1102 behavior preserved)