Better invite code error message
parent
3725a2eed1
commit
4eb993e885
|
@ -20,6 +20,7 @@ import {makeValidHandle, createFullHandle, toNiceDomain} from '../lib/strings'
|
||||||
import {useStores, DEFAULT_SERVICE} from '../../state'
|
import {useStores, DEFAULT_SERVICE} from '../../state'
|
||||||
import {ServiceDescription} from '../../state/models/session'
|
import {ServiceDescription} from '../../state/models/session'
|
||||||
import {ServerInputModel} from '../../state/models/shell-ui'
|
import {ServerInputModel} from '../../state/models/shell-ui'
|
||||||
|
import {ComAtprotoAccountCreate} from '../../third-party/api/index'
|
||||||
|
|
||||||
enum ScreenState {
|
enum ScreenState {
|
||||||
SigninOrCreateAccount,
|
SigninOrCreateAccount,
|
||||||
|
@ -326,7 +327,11 @@ const CreateAccount = ({onPressBack}: {onPressBack: () => void}) => {
|
||||||
inviteCode,
|
inviteCode,
|
||||||
})
|
})
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
const errMsg = e.toString()
|
let errMsg = e.toString()
|
||||||
|
if (e instanceof ComAtprotoAccountCreate.InvalidInviteCodeError) {
|
||||||
|
errMsg =
|
||||||
|
'Invite code not accepted. Check that you input it correctly and try again.'
|
||||||
|
}
|
||||||
console.log(e)
|
console.log(e)
|
||||||
setIsProcessing(false)
|
setIsProcessing(false)
|
||||||
setError(errMsg.replace(/^Error:/, ''))
|
setError(errMsg.replace(/^Error:/, ''))
|
||||||
|
|
Loading…
Reference in New Issue