File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1- import React , { useState } from 'react'
1+ import React , { useState , useRef } from 'react'
22import {
33 Dimensions ,
44 ImageBackground ,
@@ -21,6 +21,7 @@ const store = 'dimensionsoftware', // YOUR-STORE.myshopify.com
2121export default function Login ( ) {
2222 const [ email , setEmail ] = useState < string > ( '' ) ,
2323 [ socialUri , setSocialUri ] = useState < string > ( '' ) ,
24+ webView = useRef ( null ) ,
2425 doLogin = async ( ) => {
2526 // initiate passwordless email login
2627 const r = await passwordless ( { email } )
@@ -87,6 +88,7 @@ export default function Login() {
8788 </ View >
8889 < Modal visible = { ! ! socialUri } animationType = "slide" >
8990 < WebView
91+ ref = { webView }
9092 source = { {
9193 uri : socialUri
9294 } }
@@ -95,8 +97,10 @@ export default function Login() {
9597 // success, so--
9698 setSocialUri ( '' ) // reset ui
9799 Linking . openURL ( e . url ) // send CustomerAccessToken to app
100+ webView . current . stopLoading ( ) // halt webView
101+ return false
98102 }
99- return ! ! ! e . url . match ( / ^ p a s s w o r d l e s s - / )
103+ return true
100104 } }
101105 javaScriptEnabled = { true }
102106 domStorageEnabled = { true }
You can’t perform that action at this time.
0 commit comments