Remove IoniaMerchantService from IoniaViewModel

This commit is contained in:
M 2022-06-21 10:31:38 +01:00
parent aab6d89afa
commit 06a6d8d8bb
2 changed files with 3 additions and 6 deletions

View file

@ -655,7 +655,7 @@ Future setup(
() => IoniaService(getIt.get<FlutterSecureStorage>(), getIt.get<IoniaApi>()));
getIt.registerFactory(
() => IoniaViewModel(ioniaService: getIt.get<IoniaService>(), ioniaMerchantService: getIt.get<IoniaMerchantService>()));
() => IoniaViewModel(ioniaService: getIt.get<IoniaService>()));
getIt.registerFactory(() => IoniaCreateAccountPage(getIt.get<IoniaViewModel>()));

View file

@ -1,7 +1,6 @@
import 'package:cake_wallet/ionia/ionia_service.dart';
import 'package:cake_wallet/ionia/ionia_create_state.dart';
import 'package:cake_wallet/ionia/ionia_merchant.dart';
import 'package:cake_wallet/ionia/ionia_merchant_service.dart';
import 'package:cake_wallet/ionia/ionia_virtual_card.dart';
import 'package:mobx/mobx.dart';
part 'ionia_view_model.g.dart';
@ -10,7 +9,7 @@ class IoniaViewModel = IoniaViewModelBase with _$IoniaViewModel;
abstract class IoniaViewModelBase with Store {
IoniaViewModelBase({this.ioniaService, this.ioniaMerchantService})
IoniaViewModelBase({this.ioniaService})
: createUserState = IoniaCreateStateSuccess(),
otpState = IoniaOtpSendDisabled(),
cardState = IoniaNoCardState(), ioniaMerchants = [] {
@ -20,8 +19,6 @@ abstract class IoniaViewModelBase with Store {
_getAuthStatus().then((value) => isLoggedIn = value);
}
final IoniaMerchantService ioniaMerchantService;
final IoniaService ioniaService;
@observable
@ -100,6 +97,6 @@ abstract class IoniaViewModelBase with Store {
}
Future<List<IoniaMerchant>> _getMerchants()async{
return await ioniaMerchantService.getMerchants();
return await ioniaService.getMerchants();
}
}