File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,10 +69,14 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
6969 }
7070 }
7171
72- chrome ?. runtime ?. onMessage . addListener ( messageListener )
72+ if ( typeof chrome !== 'undefined' && chrome . runtime && chrome . runtime . onMessage ) {
73+ chrome . runtime . onMessage . addListener ( messageListener )
74+ }
7375
7476 return ( ) => {
75- chrome ?. runtime ?. onMessage . removeListener ( messageListener )
77+ if ( typeof chrome !== 'undefined' && chrome . runtime && chrome . runtime . onMessage ) {
78+ chrome . runtime . onMessage . removeListener ( messageListener )
79+ }
7680 }
7781 } , [ ] )
7882
@@ -85,6 +89,7 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
8589 const provider = searchParams . get ( 'provider' )
8690 connectTheUser ( token , provider ) . catch ( ( error ) => {
8791 openAuthModal ( )
92+ console . log ( 'error' , error )
8893 if ( error && error . code === 'auth/account-exists-with-different-credential' ) {
8994 setAuthError ( {
9095 message :
You can’t perform that action at this time.
0 commit comments