Skip to content

Commit

Permalink
Fix fpsContract not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantinullrich committed Jun 30, 2024
1 parent 78cd4d7 commit d7962ff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/src/view_model/swap_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:async/async.dart';
import 'package:flutter/cupertino.dart';
import 'package:frankencoin_wallet/generated/i18n.dart';
import 'package:frankencoin_wallet/src/core/swap/swap_routes/dfx_route.dart';
import 'package:frankencoin_wallet/src/core/swap/swap_routes/fps_routes.dart';
import 'package:frankencoin_wallet/src/core/swap/swap_routes/swap_route.dart';
import 'package:frankencoin_wallet/src/core/swap/swap_service.dart';
import 'package:frankencoin_wallet/src/entities/crypto_currency.dart';
Expand All @@ -25,6 +24,10 @@ abstract class SwapViewModelBase with Store {
final SwapService swapService;

SwapViewModelBase(this.appStore, this.sendVM, this.swapService) {
swapRoute = swapService.getRoute(
CustomErc20Token.fromCryptoCurrency(sendCurrency),
CustomErc20Token.fromCryptoCurrency(receiveCurrency));

reaction((_) => sendCurrency, (_) {
swapRoute = swapService.getRoute(
CustomErc20Token.fromCryptoCurrency(sendCurrency),
Expand Down Expand Up @@ -54,7 +57,7 @@ abstract class SwapViewModelBase with Store {
CryptoCurrency receiveCurrency = CryptoCurrency.fps;

@observable
SwapRoute swapRoute = ZCHF_FPS_SwapRoute();
late SwapRoute swapRoute;

@observable
ExecutionState state = InitialExecutionState();
Expand Down

0 comments on commit d7962ff

Please sign in to comment.