Skip to content

Commit

Permalink
fix: update DapState (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-tbd authored Sep 4, 2024
1 parent ef98115 commit 8487120
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/features/dap/dap_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class DapState {
'eth': 'USDC_ONCHAIN',
};

String? get protocol => selectedAddress?.pss.split(':').firstOrNull;
String? get protocol => selectedAddress?.protocol;

String? get paymentAddress => selectedAddress?.pss.split(':').lastOrNull;
String? get paymentAddress => selectedAddress?.pss;

List<String>? get currencies =>
moneyAddresses?.map((address) => address.currency).toList();
Expand All @@ -39,11 +39,13 @@ class DapState {
)
.toSet();

return paymentMethods
final filteredMethods = paymentMethods
?.where(
(method) => protocolKinds?.contains(method.kind) ?? false,
)
.toList();

return filteredMethods?.isEmpty ?? true ? null : filteredMethods;
}

DapState copyWith({
Expand Down

0 comments on commit 8487120

Please sign in to comment.