Unblock React Compiler for 5 components with early exits inside try (#11547)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tomasz Zawadzki
2026-08-31 15:52:17 +02:00
committed by GitHub
parent f9cf58ea44
commit a086a2ebe0
5 changed files with 45 additions and 18 deletions
@@ -83,10 +83,10 @@ export function BetaFeaturesSettingsScreen({}: Props) {
} catch (e) {
logger.error('Failed to toggle beta features', {safeMessage: e})
Toast.show(l`Something went wrong, please try again.`, {type: 'error'})
return
} finally {
setIsPending(false)
return
}
setIsPending(false)
/*
* The toggle already succeeded; re-evaluate feature gates against the new
* attribute in-session as a best-effort follow-up. A failure here should
+4 -3
View File
@@ -76,10 +76,11 @@ export function StepHandle() {
dispatch({type: 'setIsLoading', value: true})
const serviceDid = state.serviceDescription?.did ?? 'UNKNOWN'
try {
const {available: handleAvailable} = await checkHandleAvailability(
createFullHandle(handle, state.userDomain),
state.serviceDescription?.did ?? 'UNKNOWN',
serviceDid,
{},
)
@@ -90,6 +91,7 @@ export function StepHandle() {
value: _(msg`That username is already taken`),
field: 'handle',
})
dispatch({type: 'setIsLoading', value: false})
return
} else {
ax.metric('signup:handleAvailable', {typeahead: false})
@@ -99,9 +101,8 @@ export function StepHandle() {
safeMessage: error,
})
// do nothing on error, let them pass
} finally {
dispatch({type: 'setIsLoading', value: false})
}
dispatch({type: 'setIsLoading', value: false})
ax.metric('signup:nextPressed', {
activeStep: state.activeStep,
+4 -3
View File
@@ -322,6 +322,7 @@ export function useSubmitSignup() {
dispatch({type: 'setError', value: ''})
dispatch({type: 'setIsLoading', value: true})
const verificationCode = state.pendingSubmit?.verificationCode
try {
await createAccount(
{
@@ -331,7 +332,7 @@ export function useSubmitSignup() {
password: state.password,
birthDate: state.dateOfBirth,
inviteCode: state.inviteCode.trim(),
verificationCode: state.pendingSubmit?.verificationCode,
verificationCode,
},
{
signupDuration: Date.now() - state.signupStartTime,
@@ -360,6 +361,7 @@ export function useSubmitSignup() {
field: 'invite-code',
})
dispatch({type: 'setStep', value: SignupStep.INFO})
dispatch({type: 'setIsLoading', value: false})
return
}
@@ -384,9 +386,8 @@ export function useSubmitSignup() {
safeMessage: e,
})
}
} finally {
dispatch({type: 'setIsLoading', value: false})
}
dispatch({type: 'setIsLoading', value: false})
},
[l, ax, createAccount, onboardingDispatch],
)