websocket: remove explicit disconnect

This commit is contained in:
tobtoht
2023-03-01 13:28:01 +01:00
parent 103bc6408f
commit f416cd6e84
11 changed files with 34 additions and 42 deletions
+2 -2
View File
@@ -13,10 +13,10 @@ AppData::AppData(QObject *parent)
auto genesis_timestamp = this->restoreHeights[NetworkType::Type::MAINNET]->data.firstKey();
this->txFiatHistory = new TxFiatHistory(genesis_timestamp, Config::defaultConfigDir().path(), this);
connect(&websocketNotifier()->websocketClient, &WebsocketClient::connectionEstablished, this->txFiatHistory, &TxFiatHistory::onUpdateDatabase);
connect(websocketNotifier()->websocketClient, &WebsocketClient::connectionEstablished, this->txFiatHistory, &TxFiatHistory::onUpdateDatabase);
connect(this->txFiatHistory, &TxFiatHistory::requestYear, [](int year){
QByteArray data = QString(R"({"cmd": "txFiatHistory", "data": {"year": %1}})").arg(year).toUtf8();
websocketNotifier()->websocketClient.sendMsg(data);
websocketNotifier()->websocketClient->sendMsg(data);
});
connect(websocketNotifier(), &WebsocketNotifier::CryptoRatesReceived, &this->prices, &Prices::cryptoPricesReceived);