Insert user before loading avatar/display name

This commit is contained in:
Loren Burkholder 2021-07-20 19:20:55 -04:00
parent c78c284898
commit 77c636f3d3

View file

@ -19,10 +19,12 @@ InviteesModel::addUser(QString mxid)
beginInsertRows(QModelIndex(), invitees_.count(), invitees_.count()); beginInsertRows(QModelIndex(), invitees_.count(), invitees_.count());
auto invitee = new Invitee{mxid, this}; auto invitee = new Invitee{mxid, this};
connect(invitee, &Invitee::userInfoLoaded, this, [this]() { endInsertRows(); }); auto indexOfInvitee = invitees_.count();
connect(invitee, &Invitee::userInfoLoaded, this, [this, indexOfInvitee]() { emit dataChanged(index(indexOfInvitee), index(indexOfInvitee)); });
invitees_.push_back(invitee); invitees_.push_back(invitee);
endInsertRows();
emit countChanged(); emit countChanged();
} }