fix: show particle after creation

This commit is contained in:
talksik
2026-02-06 15:06:25 -08:00
parent 01529e8d14
commit 7dd84ff9b1
+9 -1
View File
@@ -527,7 +527,15 @@ void MainWindow::onTextMessageSubmitted(const QString &text)
if (m_selectedStreamId.isEmpty())
return;
m_store->createParticle(m_selectedStreamId, "text", {{"content", text}});
auto *op = m_store->createParticle(m_selectedStreamId, "text", {{"content", text}});
connect(op, &Operation::success, this, [this](const QJsonDocument &) {
int lastRow = m_particleListModel->rowCount() - 1;
if (lastRow >= 0)
{
ui->particlesView->setCurrentIndex(m_particleListModel->index(lastRow, 0));
ui->particlesView->setFocus();
}
});
}
void MainWindow::mousePressEvent(QMouseEvent *event)