plugins: localmonero: fix ws notifier

This commit is contained in:
tobtoht
2023-12-12 17:18:13 +01:00
parent 650bdd2370
commit de5642011e
3 changed files with 11 additions and 12 deletions
+11 -3
View File
@@ -42,9 +42,17 @@ LocalMoneroWidget::LocalMoneroWidget(QWidget *parent, Wallet *wallet)
connect(m_api, &LocalMoneroApi::ApiResponse, this, &LocalMoneroWidget::onApiResponse);
connect(ui->btn_loadMore, &QPushButton::clicked, this, &LocalMoneroWidget::onLoadMore);
connect(websocketNotifier(), &WebsocketNotifier::LocalMoneroCountriesReceived, this, &LocalMoneroWidget::onWsCountriesReceived);
connect(websocketNotifier(), &WebsocketNotifier::LocalMoneroCurrenciesReceived, this, &LocalMoneroWidget::onWsCurrenciesReceived);
connect(websocketNotifier(), &WebsocketNotifier::LocalMoneroPaymentMethodsReceived, this, &LocalMoneroWidget::onWsPaymentMethodsReceived);
connect(websocketNotifier(), &WebsocketNotifier::dataReceived, this, [this](const QString& type, const QJsonValue& json) {
if (type == "localmonero_countries") {
this->onWsCountriesReceived(json.toArray());
}
else if (type == "localmonero_currencies") {
this->onWsCurrenciesReceived(json.toArray());
}
else if (type == "localmonero_payment_methods") {
this->onWsPaymentMethodsReceived(json.toObject());
}
});
connect(ui->combo_currency, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &LocalMoneroWidget::updatePaymentMethods);