feat: update wallet checks from isHardwareWallet to isLedger

This commit is contained in:
Charon-Fan 2024-12-12 10:48:24 +08:00
parent c6e90741b7
commit 62d0d1a574
5 changed files with 6 additions and 6 deletions

View file

@ -290,7 +290,7 @@ class DFXBuyProvider extends BuyProvider {
required bool isBuyAction,
required String cryptoCurrencyAddress,
String? countryCode}) async {
if (wallet.isHardwareWallet) {
if (wallet.isLedger) {
if (!ledgerVM!.isConnected) {
await Navigator.of(context).pushNamed(Routes.connectDevices,
arguments: ConnectDevicePageParams(

View file

@ -102,7 +102,7 @@ class RobinhoodBuyProvider extends BuyProvider {
required bool isBuyAction,
required String cryptoCurrencyAddress,
String? countryCode}) async {
if (wallet.isHardwareWallet) {
if (wallet.isLedger) {
if (!ledgerVM!.isConnected) {
await Navigator.of(context).pushNamed(Routes.connectDevices,
arguments: ConnectDevicePageParams(

View file

@ -997,12 +997,12 @@ Future<void> setup({
getIt.registerFactory<RobinhoodBuyProvider>(() => RobinhoodBuyProvider(
wallet: getIt.get<AppStore>().wallet!,
ledgerVM:
getIt.get<AppStore>().wallet!.isHardwareWallet ? getIt.get<LedgerViewModel>() : null));
getIt.get<AppStore>().wallet!.isLedger ? getIt.get<LedgerViewModel>() : null));
getIt.registerFactory<DFXBuyProvider>(() => DFXBuyProvider(
wallet: getIt.get<AppStore>().wallet!,
ledgerVM:
getIt.get<AppStore>().wallet!.isHardwareWallet ? getIt.get<LedgerViewModel>() : null));
getIt.get<AppStore>().wallet!.isLedger ? getIt.get<LedgerViewModel>() : null));
getIt.registerFactory<MoonPayProvider>(() => MoonPayProvider(
settingsStore: getIt.get<AppStore>().settingsStore,

View file

@ -393,7 +393,7 @@ class SendPage extends BasePage {
return;
}
if (sendViewModel.wallet.isHardwareWallet) {
if (sendViewModel.wallet.isLedger) {
if (!sendViewModel.ledgerViewModel!.isConnected) {
await Navigator.of(context).pushNamed(
Routes.connectDevices,

View file

@ -389,7 +389,7 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
try {
state = IsExecutingState();
if (wallet.isHardwareWallet) state = IsAwaitingDeviceResponseState();
if (wallet.isLedger) state = IsAwaitingDeviceResponseState();
pendingTransaction = await wallet.createTransaction(_credentials());