Fix crash when opening invitation

There seem to be problems with the model not updating correctly when the room is set. This fix is a bit dirty, but seems to work well enough

BUG: 493197
This commit is contained in:
Tobias Fella
2024-10-10 20:55:15 +02:00
parent b5fdb3d0db
commit 0ab3bfd4f3

View File

@@ -94,7 +94,7 @@ int TimelineBeginningModel::rowCount(const QModelIndex &parent) const
{ {
Q_UNUSED(parent) Q_UNUSED(parent)
if (m_room == nullptr) { if (m_room == nullptr) {
return 0; return 1;
} }
return m_room->successorId().isEmpty() ? 0 : 1; return m_room->successorId().isEmpty() ? 0 : 1;
} }
@@ -159,7 +159,7 @@ int TimelineEndModel::rowCount(const QModelIndex &parent) const
{ {
Q_UNUSED(parent) Q_UNUSED(parent)
if (m_room == nullptr) { if (m_room == nullptr) {
return 0; return 1;
} }
return m_room->predecessorId().isEmpty() ? 1 : (m_room->allHistoryLoaded() ? 2 : 1); return m_room->predecessorId().isEmpty() ? 1 : (m_room->allHistoryLoaded() ? 2 : 1);
} }