File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,16 @@ function connect(
21
21
if ( address === null ) {
22
22
// wait for address sync if is still on initial value
23
23
if ( stateSyncStatus . address ) {
24
- try {
25
- await stateSyncStatus . address
26
- } catch ( error ) { }
24
+ await new Promise ( resolve => {
25
+ stateSyncStatus . address && stateSyncStatus . address . then ( resolve )
26
+
27
+ setTimeout ( ( ) => {
28
+ if ( address === null ) {
29
+ // if prom isn't resolving after 250ms, then stop waiting
30
+ resolve ( )
31
+ }
32
+ } , 250 )
33
+ } )
27
34
}
28
35
}
29
36
Original file line number Diff line number Diff line change @@ -24,9 +24,16 @@ function network(
24
24
if ( network === null ) {
25
25
// wait for network sync if is still on initial value
26
26
if ( stateSyncStatus . network ) {
27
- try {
28
- await stateSyncStatus . network
29
- } catch ( error ) { }
27
+ await new Promise ( resolve => {
28
+ stateSyncStatus . network && stateSyncStatus . network . then ( resolve )
29
+
30
+ setTimeout ( ( ) => {
31
+ if ( network === null ) {
32
+ // if prom isn't resolving after 250ms, then stop waiting
33
+ resolve ( )
34
+ }
35
+ } , 250 )
36
+ } )
30
37
}
31
38
}
32
39
You can’t perform that action at this time.
0 commit comments