File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ export default function RealmInputScreen(props: Props): Node {
36
36
37
37
const [ progress , setProgress ] = React . useState ( false ) ;
38
38
const [ realmInputValue , setRealmInputValue ] = React . useState ( '' ) ;
39
+ const parsedRealm = urlFromInputValue ( realmInputValue ) ;
39
40
const [ error , setError ] = React . useState ( null ) ;
40
41
41
42
const textInputRef = React . useRef < React$ElementRef < typeof TextInput > | null > ( null ) ;
@@ -59,7 +60,6 @@ export default function RealmInputScreen(props: Props): Node {
59
60
) ;
60
61
61
62
const tryRealm = React . useCallback ( async ( ) => {
62
- const parsedRealm = urlFromInputValue ( realmInputValue ) ;
63
63
if ( ! parsedRealm ) {
64
64
setError ( 'Please enter a valid URL.' ) ;
65
65
return ;
@@ -85,7 +85,7 @@ export default function RealmInputScreen(props: Props): Node {
85
85
} finally {
86
86
setProgress ( false ) ;
87
87
}
88
- } , [ navigation , realmInputValue ] ) ;
88
+ } , [ navigation , parsedRealm ] ) ;
89
89
90
90
const styles = React . useMemo (
91
91
( ) =>
@@ -148,7 +148,7 @@ export default function RealmInputScreen(props: Props): Node {
148
148
text = "Enter"
149
149
progress = { progress }
150
150
onPress = { tryRealm }
151
- disabled = { urlFromInputValue ( realmInputValue ) === undefined }
151
+ disabled = { parsedRealm === undefined }
152
152
/>
153
153
</ Screen >
154
154
) ;
You can’t perform that action at this time.
0 commit comments