From 9de16be012d2b97c09c6b8ae2442b58893849beb Mon Sep 17 00:00:00 2001 From: Evgeny Date: Sun, 19 Jul 2026 10:50:25 +0300 Subject: [PATCH] fix(chatgui): remove duplicate loadChannels after JoinDialog close, remove 800ms delay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - showJoinDialog: don't call loadChannels after dialog close — channel already in model via CHANNEL_UPDATED event, online badge via CHANNEL_PEERS_ONLINE. Duplicate loadChannels was resetting the peer online count. - onConnectResult: remove 800ms QTimer — dialog closes immediately. Channel data arrives independently through the event pipeline. --- tools/chatgui/src/joindialog.cpp | 10 ++++------ tools/chatgui/src/mainwindow.cpp | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tools/chatgui/src/joindialog.cpp b/tools/chatgui/src/joindialog.cpp index c7a40e3a..ffb1a0f5 100644 --- a/tools/chatgui/src/joindialog.cpp +++ b/tools/chatgui/src/joindialog.cpp @@ -195,12 +195,10 @@ void JoinDialog::onConnectResult(uint64_t nodeId, uint64_t channelId, int result if (!m_connecting || nodeId != m_pendingNodeId) return; if (result == 0) { - setStatus("Connected! Waiting for channel data..."); - QTimer::singleShot(800, this, [this] { - QString cid = QString::number(m_pendingChannelId); - emit joined(cid); - accept(); - }); + setStatus("Connected!"); + QString cid = QString::number(m_pendingChannelId); + emit joined(cid); + accept(); } else { m_connecting = false; m_connectBtn->setEnabled(true); diff --git a/tools/chatgui/src/mainwindow.cpp b/tools/chatgui/src/mainwindow.cpp index 71a928b5..2f08cf2e 100644 --- a/tools/chatgui/src/mainwindow.cpp +++ b/tools/chatgui/src/mainwindow.cpp @@ -267,8 +267,7 @@ void MainWindow::showJoinDialog() { } JoinDialog dlg(m_node, m_db, this, autoLink); - if (dlg.exec() == QDialog::Accepted) - m_channelList->loadChannels(); + dlg.exec(); } void MainWindow::showSettings() {