fix: show particle after creation
This commit is contained in:
+9
-1
@@ -527,7 +527,15 @@ void MainWindow::onTextMessageSubmitted(const QString &text)
|
|||||||
if (m_selectedStreamId.isEmpty())
|
if (m_selectedStreamId.isEmpty())
|
||||||
return;
|
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)
|
void MainWindow::mousePressEvent(QMouseEvent *event)
|
||||||
|
|||||||
Reference in New Issue
Block a user