Browse Source

fix(chatgui): remove duplicate loadChannels after JoinDialog close, remove 800ms delay

- 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.
topo_upd
Evgeny 2 months ago
parent
commit
9de16be012
  1. 10
      tools/chatgui/src/joindialog.cpp
  2. 3
      tools/chatgui/src/mainwindow.cpp

10
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 (!m_connecting || nodeId != m_pendingNodeId) return;
if (result == 0) { if (result == 0) {
setStatus("Connected! Waiting for channel data..."); setStatus("Connected!");
QTimer::singleShot(800, this, [this] { QString cid = QString::number(m_pendingChannelId);
QString cid = QString::number(m_pendingChannelId); emit joined(cid);
emit joined(cid); accept();
accept();
});
} else { } else {
m_connecting = false; m_connecting = false;
m_connectBtn->setEnabled(true); m_connectBtn->setEnabled(true);

3
tools/chatgui/src/mainwindow.cpp

@ -267,8 +267,7 @@ void MainWindow::showJoinDialog() {
} }
JoinDialog dlg(m_node, m_db, this, autoLink); JoinDialog dlg(m_node, m_db, this, autoLink);
if (dlg.exec() == QDialog::Accepted) dlg.exec();
m_channelList->loadChannels();
} }
void MainWindow::showSettings() { void MainWindow::showSettings() {

Loading…
Cancel
Save