mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-22 02:34:30 +00:00
send: don't allow fiat conversion if websocket is disabled
This commit is contained in:
parent
7961b74cc6
commit
199e085709
3 changed files with 16 additions and 0 deletions
|
@ -606,6 +606,7 @@ void MainWindow::onWebsocketStatusChanged(bool enabled) {
|
|||
ui->tabWidget->setTabVisible(Tabs::EXCHANGES, enabled && config()->get(Config::showTabExchange).toBool());
|
||||
|
||||
m_historyWidget->setWebsocketEnabled(enabled);
|
||||
m_sendWidget->setWebsocketEnabled(enabled);
|
||||
|
||||
#ifdef HAS_XMRIG
|
||||
m_xmrig->setDownloadsTabEnabled(enabled);
|
||||
|
|
|
@ -236,6 +236,10 @@ void SendWidget::updateConversionLabel() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (config()->get(Config::disableWebsocket).toBool()) {
|
||||
return;
|
||||
}
|
||||
|
||||
QString conversionAmountStr = [this]{
|
||||
QString currency = ui->comboCurrencySelection->currentText();
|
||||
if (currency != "XMR") {
|
||||
|
@ -331,6 +335,16 @@ void SendWidget::disableSendButton() {
|
|||
ui->btnSend->setEnabled(false);
|
||||
}
|
||||
|
||||
void SendWidget::setWebsocketEnabled(bool enabled) {
|
||||
this->updateConversionLabel();
|
||||
if (enabled) {
|
||||
this->setupComboBox();
|
||||
} else {
|
||||
ui->comboCurrencySelection->clear();
|
||||
ui->comboCurrencySelection->insertItem(0, "XMR");
|
||||
}
|
||||
}
|
||||
|
||||
void SendWidget::onDataPasted(const QString &data) {
|
||||
if (!data.isEmpty()) {
|
||||
QVariantMap uriData = m_ctx->wallet->parse_uri_to_object(data);
|
||||
|
|
|
@ -41,6 +41,7 @@ public slots:
|
|||
void onOpenAliasResolved(const QString &openAlias, const QString &address, bool dnssecValid);
|
||||
void onPreferredFiatCurrencyChanged();
|
||||
void disableSendButton();
|
||||
void setWebsocketEnabled(bool enabled);
|
||||
|
||||
void onInitiateTransaction();
|
||||
void onEndTransaction();
|
||||
|
|
Loading…
Reference in a new issue