File tree 2 files changed +55
-3
lines changed
2 files changed +55
-3
lines changed Original file line number Diff line number Diff line change 128
128
"views.Satscard.slotStatus" : " Slot status" ,
129
129
"views.Satscard.generateAddress" : " Generate address" ,
130
130
"views.Satscard.tapsignerNotSupported" : " Tapsigner not supported" ,
131
+ "views.Satscard.wait" : " Wait and unlock rate-limited card" ,
131
132
"views.Settings.AddEditNode.certificateButton" : " Certificate Install Instructions" ,
132
133
"views.Settings.AddEditNode.nodeConfig" : " Node Configuration" ,
133
134
"views.Settings.AddEditNode.connectionStringClipboard" : " Detected the following connection string in your clipboard" ,
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ interface SatscardState {
44
44
selectedSlot : number ;
45
45
selectedSlotIndex : number ;
46
46
selectedSlotStatus : string ;
47
+ rateLimited : boolean ;
47
48
}
48
49
49
50
interface CardStatus {
@@ -74,7 +75,8 @@ export default class Satscard extends React.Component<
74
75
privkey : '' ,
75
76
slotStatus : '' ,
76
77
tapsignerError : false ,
77
- error : ''
78
+ error : '' ,
79
+ rateLimited : false
78
80
} ;
79
81
}
80
82
@@ -101,7 +103,8 @@ export default class Satscard extends React.Component<
101
103
error,
102
104
selectedSlot,
103
105
selectedSlotIndex,
104
- selectedSlotStatus
106
+ selectedSlotStatus,
107
+ rateLimited
105
108
} = this . state ;
106
109
107
110
const BackButton = ( ) => (
@@ -561,7 +564,55 @@ export default class Satscard extends React.Component<
561
564
error :
562
565
err . error ||
563
566
err . message ||
564
- err . toString ( )
567
+ err . toString ( ) ,
568
+ rateLimited :
569
+ err . toString ( ) ===
570
+ 'Error: 429 on dump: rate limited'
571
+ } ) ;
572
+ }
573
+
574
+ if ( Platform . OS === 'android' ) {
575
+ await card . endNfcSession ( ) ;
576
+ ModalStore . toggleAndroidNfcModal ( false ) ;
577
+ }
578
+ } }
579
+ />
580
+ </ View >
581
+ ) }
582
+ { ! cardStatus && rateLimited && (
583
+ < View style = { styles . button } >
584
+ < Button
585
+ title = { localeString ( 'views.Satscard.wait' ) }
586
+ onPress = { async ( ) => {
587
+ try {
588
+ awaitNfc ( ) ;
589
+ await card . nfcWrapper ( async ( ) => {
590
+ const status = await card . first_look ( ) ;
591
+ if ( status . auth_delay ) {
592
+ for ( let i = 0 ; i < status . auth_delay ; i ++ ) {
593
+ await card . wait ( ) ;
594
+ }
595
+ }
596
+ } ) ;
597
+
598
+ this . setState ( {
599
+ rateLimited : false
600
+ } ) ;
601
+
602
+ if ( Platform . OS === 'android' ) {
603
+ ModalStore . toggleAndroidNfcModal (
604
+ false
605
+ ) ;
606
+ }
607
+ } catch ( err ) {
608
+ this . setState ( {
609
+ error :
610
+ err . error ||
611
+ err . message ||
612
+ err . toString ( ) ,
613
+ rateLimited :
614
+ err . toString ( ) ===
615
+ 'Error: 429 on dump: rate limited'
565
616
} ) ;
566
617
}
567
618
You can’t perform that action at this time.
0 commit comments