mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Move revolutAccountsUpdateHandler code up to BisqSetup
This commit is contained in:
parent
c87899c662
commit
9e6db6e738
2 changed files with 8 additions and 13 deletions
|
@ -114,6 +114,7 @@ import java.util.Set;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
|
||||
|
@ -851,7 +852,13 @@ public class BisqSetup {
|
|||
priceAlert.onAllServicesInitialized();
|
||||
marketAlerts.onAllServicesInitialized();
|
||||
|
||||
user.onAllServicesInitialized(revolutAccountsUpdateHandler);
|
||||
if (revolutAccountsUpdateHandler != null) {
|
||||
revolutAccountsUpdateHandler.accept(user.getPaymentAccountsAsObservable().stream()
|
||||
.filter(paymentAccount -> paymentAccount instanceof RevolutAccount)
|
||||
.map(paymentAccount -> (RevolutAccount) paymentAccount)
|
||||
.filter(RevolutAccount::userNameNotSet)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
allBasicServicesInitialized = true;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import bisq.core.locale.TradeCurrency;
|
|||
import bisq.core.notifications.alerts.market.MarketAlertFilter;
|
||||
import bisq.core.notifications.alerts.price.PriceAlertFilter;
|
||||
import bisq.core.payment.PaymentAccount;
|
||||
import bisq.core.payment.RevolutAccount;
|
||||
import bisq.core.support.dispute.arbitration.arbitrator.Arbitrator;
|
||||
import bisq.core.support.dispute.mediation.mediator.Mediator;
|
||||
import bisq.core.support.dispute.refund.refundagent.RefundAgent;
|
||||
|
@ -51,7 +50,6 @@ import java.util.HashSet;
|
|||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -128,16 +126,6 @@ public class User implements PersistedDataHost {
|
|||
// API
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public void onAllServicesInitialized(@Nullable Consumer<List<RevolutAccount>> resultHandler) {
|
||||
if (resultHandler != null) {
|
||||
resultHandler.accept(paymentAccountsAsObservable.stream()
|
||||
.filter(paymentAccount -> paymentAccount instanceof RevolutAccount)
|
||||
.map(paymentAccount -> (RevolutAccount) paymentAccount)
|
||||
.filter(RevolutAccount::userNameNotSet)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Arbitrator getAcceptedArbitratorByAddress(NodeAddress nodeAddress) {
|
||||
final List<Arbitrator> acceptedArbitrators = userPayload.getAcceptedArbitrators();
|
||||
|
|
Loading…
Add table
Reference in a new issue