File tree 3 files changed +11
-4
lines changed
3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ interface Props {
42
42
config ?: WormholeConnectConfig ;
43
43
}
44
44
45
+ let _HAS_SET_CONFIG = false ;
46
+
45
47
// since this will be embedded, we'll have to use pseudo routes instead of relying on the url
46
48
function AppRouter ( props : Props ) {
47
49
const { classes } = useStyles ( ) ;
@@ -53,7 +55,7 @@ function AppRouter(props: Props) {
53
55
//
54
56
// We don't allow config changes afterwards because they could lead to lots of
55
57
// broken and undesired behavior.
56
- React . useEffect ( ( ) => {
58
+ if ( ! _HAS_SET_CONFIG ) {
57
59
if ( ! isEmptyObject ( props . config ) ) {
58
60
setConfig ( props . config ) ;
59
61
dispatch ( clearTransfer ( ) ) ;
@@ -63,7 +65,9 @@ function AppRouter(props: Props) {
63
65
type : 'load' ,
64
66
config : props . config ,
65
67
} ) ;
66
- } , [ ] ) ;
68
+
69
+ _HAS_SET_CONFIG = true ;
70
+ }
67
71
68
72
const route = useSelector ( ( state : RootState ) => state . router . route ) ;
69
73
const prevRoute = usePrevious ( route ) ;
Original file line number Diff line number Diff line change @@ -9,12 +9,15 @@ import {
9
9
export function wrapEventHandler (
10
10
integrationHandler ?: WormholeConnectEventHandler ,
11
11
) : TriggerEventHandler {
12
+ const host =
13
+ typeof window === 'undefined' ? undefined : window . location ?. host ;
14
+
12
15
return function ( event : WormholeConnectEventCore ) {
13
16
const eventWithMeta : WormholeConnectEvent = {
14
17
meta : {
15
18
version : CONNECT_VERSION ,
16
19
hash : CONNECT_GIT_HASH ,
17
- host : window ?. location ?. host ,
20
+ host,
18
21
} ,
19
22
...event ,
20
23
} ;
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ export interface WormholeConnectEventMeta {
99
99
meta : {
100
100
version : string ;
101
101
hash : string ;
102
- host : string ;
102
+ host ? : string ;
103
103
} ;
104
104
}
105
105
You can’t perform that action at this time.
0 commit comments