File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,17 @@ class _ActivateWalletWidgetState extends ConsumerState<ActivateWalletWidget> {
4343
4444 try {
4545 final price = await StellarService .getTFTPriceFromXLM ();
46+ if (price == 0 ) {
47+ final price =
48+ await TFChainService .getTFTPrice (Globals ().chainUrl) * 0.5 ;
49+ if (mounted) {
50+ setState (() {
51+ tftPrice = price.ceil ();
52+ isLoadingPrice = false ;
53+ });
54+ }
55+ return ;
56+ }
4657 if (mounted) {
4758 setState (() {
4859 tftPrice = price;
@@ -51,12 +62,24 @@ class _ActivateWalletWidgetState extends ConsumerState<ActivateWalletWidget> {
5162 }
5263 } catch (e) {
5364 logger.e ('Failed to load TFT price: $e ' );
54- final price = await TFChainService .getTFTPrice (Globals ().chainUrl) * 0.5 ;
55- if (mounted) {
56- setState (() {
57- tftPrice = price.ceil ();
58- isLoadingPrice = false ;
59- });
65+ try {
66+ final price =
67+ await TFChainService .getTFTPrice (Globals ().chainUrl) * 0.5 ;
68+ if (mounted) {
69+ setState (() {
70+ tftPrice = price.ceil ();
71+ isLoadingPrice = false ;
72+ });
73+ }
74+ } catch (tfchainError) {
75+ logger
76+ .e ('Failed to load TFT price from TFChain fallback: $tfchainError ' );
77+ if (mounted) {
78+ setState (() {
79+ tftPrice = 0 ;
80+ isLoadingPrice = false ;
81+ });
82+ }
6083 }
6184 }
6285 }
You can’t perform that action at this time.
0 commit comments