Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Always display next button on login page (#5326)

Co-authored-by: Vinícius Souza <39967235+vinifsouza@users.noreply.github.com>
Co-authored-by: Hailey <me@haileyok.com>

authored by

Eric Bailey
Vinícius Souza
Hailey
and committed by
GitHub
88813f57 53338217

+10 -24
+1 -2
src/screens/Login/ForgotPasswordForm.tsx
··· 144 144 variant="solid" 145 145 color={'primary'} 146 146 size="medium" 147 - onPress={onPressNext} 148 - disabled={!email}> 147 + onPress={onPressNext}> 149 148 <ButtonText> 150 149 <Trans>Next</Trans> 151 150 </ButtonText>
+9 -22
src/screens/Login/LoginForm.tsx
··· 60 60 const {track} = useAnalytics() 61 61 const t = useTheme() 62 62 const [isProcessing, setIsProcessing] = useState<boolean>(false) 63 - const [isReady, setIsReady] = useState<boolean>(false) 64 63 const [isAuthFactorTokenNeeded, setIsAuthFactorTokenNeeded] = 65 64 useState<boolean>(false) 66 65 const identifierValueRef = useRef<string>(initialHandle || '') ··· 83 82 Keyboard.dismiss() 84 83 LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut) 85 84 setError('') 86 - setIsProcessing(true) 87 85 88 86 const identifier = identifierValueRef.current.toLowerCase().trim() 89 87 const password = passwordValueRef.current 90 88 const authFactorToken = authFactorTokenValueRef.current 89 + 90 + if (!identifier || !password) { 91 + setError(_(msg`Invalid username or password`)) 92 + return 93 + } 94 + 95 + setIsProcessing(true) 91 96 92 97 try { 93 98 // try to guess the handle if the user just gave their own username ··· 157 162 } 158 163 } 159 164 160 - const checkIsReady = () => { 161 - if ( 162 - !!serviceDescription && 163 - !!identifierValueRef.current && 164 - !!passwordValueRef.current 165 - ) { 166 - if (!isReady) { 167 - setIsReady(true) 168 - } 169 - } else { 170 - if (isReady) { 171 - setIsReady(false) 172 - } 173 - } 174 - } 175 - 176 165 return ( 177 166 <FormContainer testID="loginForm" titleText={<Trans>Sign in</Trans>}> 178 167 <View> ··· 204 193 defaultValue={initialHandle || ''} 205 194 onChangeText={v => { 206 195 identifierValueRef.current = v 207 - checkIsReady() 208 196 }} 209 197 onSubmitEditing={() => { 210 198 passwordRef.current?.focus() ··· 233 221 clearButtonMode="while-editing" 234 222 onChangeText={v => { 235 223 passwordValueRef.current = v 236 - checkIsReady() 237 224 }} 238 225 onSubmitEditing={onPressNext} 239 226 blurOnSubmit={false} // HACK: https://github.com/facebook/react-native/issues/21911#issuecomment-558343069 Keyboard blur behavior is now handled in onSubmitEditing ··· 325 312 <Trans>Connecting...</Trans> 326 313 </Text> 327 314 </> 328 - ) : isReady ? ( 315 + ) : ( 329 316 <Button 330 317 testID="loginNextButton" 331 318 label={_(msg`Next`)} ··· 339 326 </ButtonText> 340 327 {isProcessing && <ButtonIcon icon={Loader} />} 341 328 </Button> 342 - ) : undefined} 329 + )} 343 330 </View> 344 331 </FormContainer> 345 332 )