File tree Expand file tree Collapse file tree 6 files changed +40
-8
lines changed Expand file tree Collapse file tree 6 files changed +40
-8
lines changed Original file line number Diff line number Diff line change
1
+
2
+ class PALICONNECT {
3
+ constructor ( ) {
4
+ this . connect ( )
5
+ }
6
+ async connect ( ) {
7
+ if ( window . ConnectionsController ) {
8
+ var connectedAccount
9
+ try {
10
+ connectedAccount = await window . ConnectionsController . getConnectedAccount ( )
11
+ . catch ( function ( rejected ) {
12
+ console . log ( "paliConnect error: " + rejected )
13
+ } ) ;
14
+ if ( ! connectedAccount ) {
15
+ await window . ConnectionsController . connectWallet ( )
16
+ . catch ( function ( rejected ) {
17
+ console . log ( "paliConnect error: " + rejected )
18
+ } ) ;
19
+ }
20
+ } catch ( e ) {
21
+ console . log ( "paliConnect error: " + e )
22
+ }
23
+ }
24
+
25
+ }
26
+ }
27
+ export default new PALICONNECT ( ) ;
Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ class Step1FS extends Component {
152
152
const locked = await window . ConnectionsController . isLocked ( )
153
153
if ( locked ) {
154
154
this . setState ( { buttonVal1 : true , buttonValMsg1 : this . props . t ( "step2UnlockPali" ) } ) ;
155
+ return
155
156
}
156
157
if ( ! connectedAccount || locked ) {
157
158
await window . ConnectionsController . connectWallet ( )
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ class Step1 extends Component {
92
92
try {
93
93
connectedAccount = await window . ConnectionsController . getConnectedAccount ( )
94
94
. catch ( function ( rejected ) {
95
- this . setState ( { buttonValMsg : false , buttonValMsg : rejected } ) ;
95
+ this . setState ( { buttonVal : false , buttonValMsg : rejected } ) ;
96
96
return ;
97
97
} ) ;
98
98
} catch ( e ) {
@@ -102,6 +102,7 @@ class Step1 extends Component {
102
102
const locked = await window . ConnectionsController . isLocked ( )
103
103
if ( locked ) {
104
104
this . setState ( { buttonVal : true , buttonValMsg : this . props . t ( "step2UnlockPali" ) } ) ;
105
+ return ;
105
106
}
106
107
if ( ! connectedAccount || locked ) {
107
108
await window . ConnectionsController . connectWallet ( )
@@ -110,7 +111,7 @@ class Step1 extends Component {
110
111
try {
111
112
xpub = await window . ConnectionsController . getConnectedAccountXpub ( )
112
113
. catch ( function ( rejected ) {
113
- this . setState ( { buttonValMsg : false , buttonValMsg : rejected } ) ;
114
+ this . setState ( { buttonVal : false , buttonValMsg : rejected } ) ;
114
115
return ;
115
116
} ) ;
116
117
} catch ( e ) {
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ class Step1SX extends Component {
87
87
try {
88
88
connectedAccount = await window . ConnectionsController . getConnectedAccount ( )
89
89
. catch ( function ( rejected ) {
90
- this . setState ( { buttonValMsg : false , buttonValMsg : rejected } ) ;
90
+ this . setState ( { buttonVal : false , buttonValMsg : rejected } ) ;
91
91
return ;
92
92
} ) ;
93
93
} catch ( e ) {
@@ -97,6 +97,7 @@ class Step1SX extends Component {
97
97
const locked = await window . ConnectionsController . isLocked ( )
98
98
if ( locked ) {
99
99
this . setState ( { buttonVal : true , buttonValMsg : this . props . t ( "step2UnlockPali" ) } ) ;
100
+ return ;
100
101
}
101
102
if ( ! connectedAccount || locked ) {
102
103
await window . ConnectionsController . connectWallet ( )
@@ -105,7 +106,7 @@ class Step1SX extends Component {
105
106
try {
106
107
xpub = await window . ConnectionsController . getConnectedAccountXpub ( )
107
108
. catch ( function ( rejected ) {
108
- this . setState ( { buttonValMsg : false , buttonValMsg : rejected } ) ;
109
+ this . setState ( { buttonVal : false , buttonValMsg : rejected } ) ;
109
110
return ;
110
111
} ) ;
111
112
} catch ( e ) {
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ class Step1XS extends Component {
88
88
try {
89
89
connectedAccount = await window . ConnectionsController . getConnectedAccount ( )
90
90
. catch ( function ( rejected ) {
91
- this . setState ( { buttonValMsg : false , buttonValMsg : rejected } ) ;
91
+ this . setState ( { buttonVal : false , buttonValMsg : rejected } ) ;
92
92
return ;
93
93
} ) ;
94
94
} catch ( e ) {
@@ -98,6 +98,7 @@ class Step1XS extends Component {
98
98
const locked = await window . ConnectionsController . isLocked ( )
99
99
if ( locked ) {
100
100
this . setState ( { buttonVal : true , buttonValMsg : this . props . t ( "step2UnlockPali" ) } ) ;
101
+ return ;
101
102
}
102
103
if ( ! connectedAccount || locked ) {
103
104
await window . ConnectionsController . connectWallet ( )
@@ -106,7 +107,7 @@ class Step1XS extends Component {
106
107
try {
107
108
xpub = await window . ConnectionsController . getConnectedAccountXpub ( )
108
109
. catch ( function ( rejected ) {
109
- this . setState ( { buttonValMsg : false , buttonValMsg : rejected } ) ;
110
+ this . setState ( { buttonVal : false , buttonValMsg : rejected } ) ;
110
111
return ;
111
112
} ) ;
112
113
} catch ( e ) {
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ class Step2ES extends Component {
84
84
try {
85
85
connectedAccount = await window . ConnectionsController . getConnectedAccount ( )
86
86
. catch ( function ( rejected ) {
87
- this . setState ( { buttonValMsg : false , buttonValMsg : rejected } ) ;
87
+ this . setState ( { buttonVal : false , buttonValMsg : rejected } ) ;
88
88
return ;
89
89
} ) ;
90
90
} catch ( e ) {
@@ -94,6 +94,7 @@ class Step2ES extends Component {
94
94
const locked = await window . ConnectionsController . isLocked ( )
95
95
if ( locked ) {
96
96
this . setState ( { buttonVal : true , buttonValMsg : this . props . t ( "step2UnlockPali" ) } ) ;
97
+ return ;
97
98
}
98
99
if ( ! connectedAccount || locked ) {
99
100
await window . ConnectionsController . connectWallet ( )
@@ -102,7 +103,7 @@ class Step2ES extends Component {
102
103
try {
103
104
xpub = await window . ConnectionsController . getConnectedAccountXpub ( )
104
105
. catch ( function ( rejected ) {
105
- this . setState ( { buttonValMsg : false , buttonValMsg : rejected } ) ;
106
+ this . setState ( { buttonVal : false , buttonValMsg : rejected } ) ;
106
107
return ;
107
108
} ) ;
108
109
} catch ( e ) {
You can’t perform that action at this time.
0 commit comments