Skip to content

Commit

Permalink
feat: update wallet checks from isHardwareWallet to isLedger
Browse files Browse the repository at this point in the history
  • Loading branch information
Charon-Fan committed Dec 12, 2024
1 parent c6e9074 commit 62d0d1a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/buy/dfx/dfx_buy_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion lib/buy/robinhood/robinhood_buy_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions lib/di.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/screens/send/send_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/view_model/send/send_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit 62d0d1a

Please sign in to comment.