File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed
Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export function SignIn() {
5555
5656 const company = parseCompanyFromEmail ( data . email ) ;
5757 if ( company ) {
58- reoClient . identify ( {
58+ reoClient ? .identify ?. ( {
5959 username : data . email ,
6060 type : 'email' ,
6161 company,
Original file line number Diff line number Diff line change 11import { useEffect } from 'react' ;
22import { loadReoScript , ReoClient } from 'reodotdev' ;
33
4- export let reoClient : ReoClient = {
5- identify : ( ) => undefined ,
6- } ;
4+ export let reoClient : ReoClient | undefined ;
75
86export function useReo ( ) {
97 useEffect ( ( ) => {
108 if ( import . meta. env . VITE_REO_DEV_CLIENT_ID && import . meta. env . VITE_REO_DEV_CLIENT_ID !== '0' ) {
119 loadReoScript ( { clientID : import . meta. env . VITE_REO_DEV_CLIENT_ID } )
12- . then ( ( Reo ) => reoClient = Reo . init ( { clientID : import . meta. env . VITE_REO_DEV_CLIENT_ID } ) ) ;
10+ . then ( ( Reo ) => reoClient = Reo ? .init ?. ( { clientID : import . meta. env . VITE_REO_DEV_CLIENT_ID } ) ) ;
1311 }
1412 } , [ ] ) ;
1513}
Original file line number Diff line number Diff line change 11declare module 'reodotdev' {
22 export function loadReoScript ( { clientID : string } ) : Promise < {
3- init : ( { clientID : string } ) => ReoClient ;
3+ init : null | ( ( { clientID : string } ) => ReoClient ) ;
44 } > ;
55
66 export interface ReoClient {
7- identify : ( person : { username : string ; type : string ; company : string ; } ) => void ;
7+ identify : null | ( ( person : { username : string ; type : string ; company : string ; } ) => void ) ;
88 }
99}
You can’t perform that action at this time.
0 commit comments