File tree 4 files changed +13
-4
lines changed
4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,10 @@ export class FuelNetwork {
64
64
return this . walletManager . getBalance ( accountAddress , assetAddress ) ;
65
65
} ;
66
66
67
+ getWallet = ( ) : Nullable < any > => {
68
+ return this . walletManager . wallet ;
69
+ } ;
70
+
67
71
getIsExternalWallet = ( ) => false ;
68
72
69
73
getTokenList = ( ) : Token [ ] => {
Original file line number Diff line number Diff line change @@ -40,8 +40,12 @@ const Header: React.FC = observer(() => {
40
40
useEffect ( ( ) => {
41
41
accountStore . setAddress ( address ) ;
42
42
if ( address && wallet ) {
43
- const bcNetwork = FuelNetwork . getInstance ( ) ;
44
- bcNetwork . setWallet ( address , wallet ) ;
43
+ const setWallet = async ( ) => {
44
+ const bcNetwork = FuelNetwork . getInstance ( ) ;
45
+ await bcNetwork . setWallet ( address , wallet ) ;
46
+ } ;
47
+
48
+ setWallet ( ) ;
45
49
}
46
50
} , [ address , wallet ?. address ] ) ;
47
51
Original file line number Diff line number Diff line change @@ -49,8 +49,9 @@ export class BalanceStore {
49
49
update = async ( ) => {
50
50
const { accountStore } = this . rootStore ;
51
51
const bcNetwork = FuelNetwork . getInstance ( ) ;
52
+ const wallet = bcNetwork . getWallet ( ) ;
52
53
53
- if ( ! accountStore . address ) return ;
54
+ if ( ! accountStore . address || ! wallet ) return ;
54
55
55
56
try {
56
57
for ( const token of bcNetwork ! . getTokenList ( ) ) {
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ class TradeStore {
158
158
this . setSpotMarkets ( spotMarkets ) ;
159
159
await this . updateMarketPrices ( ) ;
160
160
} catch ( error ) {
161
- console . error ( "[PERP] Error init spot market" , error ) ;
161
+ console . error ( "Error init spot market" , error ) ;
162
162
}
163
163
} ;
164
164
You can’t perform that action at this time.
0 commit comments