mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-03 17:40:43 +00:00
fix: Wallet type check when registering key service (#1111)
* fix: Wallet type check when registering key service * fix: WalletConnect dependency registration
This commit is contained in:
parent
4c60b178be
commit
bad9b4c608
2 changed files with 9 additions and 5 deletions
10
lib/di.dart
10
lib/di.dart
|
@ -740,9 +740,13 @@ Future<void> setup({
|
|||
return PowNodeListViewModel(_powNodeSource, appStore);
|
||||
});
|
||||
|
||||
getIt.registerFactory(
|
||||
() => ConnectionSyncPage(getIt.get<DashboardViewModel>(), getIt.get<Web3WalletService>()),
|
||||
);
|
||||
getIt.registerFactory(() {
|
||||
final wallet = getIt.get<AppStore>().wallet;
|
||||
return ConnectionSyncPage(
|
||||
getIt.get<DashboardViewModel>(),
|
||||
wallet?.type == WalletType.ethereum ? getIt.get<Web3WalletService>() : null,
|
||||
);
|
||||
});
|
||||
|
||||
getIt.registerFactory(
|
||||
() => SecurityBackupPage(getIt.get<SecuritySettingsViewModel>(), getIt.get<AuthService>()));
|
||||
|
|
|
@ -23,7 +23,7 @@ class ConnectionSyncPage extends BasePage {
|
|||
@override
|
||||
String get title => S.current.connection_sync;
|
||||
|
||||
final Web3WalletService web3walletService;
|
||||
final Web3WalletService? web3walletService;
|
||||
final DashboardViewModel dashboardViewModel;
|
||||
|
||||
@override
|
||||
|
@ -91,7 +91,7 @@ class ConnectionSyncPage extends BasePage {
|
|||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return WalletConnectConnectionsView(web3walletService: web3walletService);
|
||||
return WalletConnectConnectionsView(web3walletService: web3walletService!);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue