mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-20 08:38:40 +02:00
Allow opening multiple windows
This commit is contained in:
@@ -20,6 +20,8 @@ QPointer<WebsocketNotifier> WebsocketNotifier::m_instance(nullptr);
|
||||
void WebsocketNotifier::onWSMessage(const QJsonObject &msg) {
|
||||
QString cmd = msg.value("cmd").toString();
|
||||
|
||||
m_cache[cmd] = msg;
|
||||
|
||||
if (cmd == "blockheights") {
|
||||
QJsonObject data = msg.value("data").toObject();
|
||||
int mainnet = data.value("mainnet").toInt();
|
||||
@@ -84,6 +86,12 @@ void WebsocketNotifier::onWSMessage(const QJsonObject &msg) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void WebsocketNotifier::emitCache() {
|
||||
for (const auto &msg : m_cache) {
|
||||
this->onWSMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
void WebsocketNotifier::onWSNodes(const QJsonArray &nodes) {
|
||||
// TODO: Refactor, should be filtered client side
|
||||
|
||||
@@ -93,7 +101,7 @@ void WebsocketNotifier::onWSNodes(const QJsonArray &nodes) {
|
||||
auto nettype = obj.value("nettype");
|
||||
auto type = obj.value("type");
|
||||
|
||||
auto networkType = config()->get(Config::networkType).toInt();
|
||||
auto networkType = constants::networkType;
|
||||
|
||||
// filter remote node network types
|
||||
if(nettype == "mainnet" && networkType != NetworkType::MAINNET)
|
||||
|
||||
Reference in New Issue
Block a user