about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2022-11-15 15:13:55 -0600
committerPaul Frazee <pfrazee@gmail.com>2022-11-15 15:13:55 -0600
commit4eb993e88596b7e30617bb6d8b50804b46651ba0 (patch)
treee81384a7a0765c9ab4385a8aa69a26941a16e6b4
parent3725a2eed10707194bc9554a9c58166e9324dfc8 (diff)
downloadvoidsky-4eb993e88596b7e30617bb6d8b50804b46651ba0.tar.zst
Better invite code error message
-rw-r--r--src/view/screens/Login.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/view/screens/Login.tsx b/src/view/screens/Login.tsx
index 328a56e9a..aca587286 100644
--- a/src/view/screens/Login.tsx
+++ b/src/view/screens/Login.tsx
@@ -20,6 +20,7 @@ import {makeValidHandle, createFullHandle, toNiceDomain} from '../lib/strings'
 import {useStores, DEFAULT_SERVICE} from '../../state'
 import {ServiceDescription} from '../../state/models/session'
 import {ServerInputModel} from '../../state/models/shell-ui'
+import {ComAtprotoAccountCreate} from '../../third-party/api/index'
 
 enum ScreenState {
   SigninOrCreateAccount,
@@ -326,7 +327,11 @@ const CreateAccount = ({onPressBack}: {onPressBack: () => void}) => {
         inviteCode,
       })
     } 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)
       setIsProcessing(false)
       setError(errMsg.replace(/^Error:/, ''))