Handle email validation error from server

This commit is contained in:
Eric Bailey
2025-07-09 20:49:27 -05:00
parent a8eba7552b
commit 61e1c68344
2 changed files with 16 additions and 3 deletions
@@ -114,8 +114,21 @@ function Inner() {
setSuccess(true)
} catch (e) {
const {clean} = cleanError(e)
setError(clean || _(msg`Something went wrong, please try again`))
const {clean, raw} = cleanError(e)
if (clean) {
setError(clean || _(msg`Something went wrong, please try again`))
} else {
let message = _(msg`Something went wrong, please try again`)
if (raw) {
if (raw.startsWith('This email address is not supported')) {
message = _(msg`Please enter a valid, non-temporary email address.`)
}
}
setError(message)
}
}
}
+1 -1
View File
@@ -207,4 +207,4 @@ export const PUBLIC_APPVIEW_DID = 'did:web:api.bsky.app'
export const PUBLIC_STAGING_APPVIEW_DID = 'did:web:api.staging.bsky.dev'
export const DEV_ENV_APPVIEW = `http://localhost:2584` // always the same
export const DEV_ENV_APPVIEW_DID = `did:plc:cs5onzby6e5yv25qfhtiatsa` // get this from `localhost:2581`
export const DEV_ENV_APPVIEW_DID = `did:plc:lmynpbfp7bbyc4pz2xjdtzsh` // get this from `localhost:2581`