Fix off-by-1 in insertRows when loading room list from initial sync
This commit is contained in:
parent
68851ee5aa
commit
801af1864c
@ -162,7 +162,7 @@ appimage-amd64:
|
||||
before_script:
|
||||
# app build requirements
|
||||
- apt-get update && apt-get install -y software-properties-common
|
||||
- add-apt-repository ppa:beineri/opt-qt-5.15.2-xenial -y
|
||||
- add-apt-repository ppa:beineri/opt-qt-5.15.2-bionic -y
|
||||
- apt-get update
|
||||
- apt-get install -y git wget curl
|
||||
|
||||
|
@ -348,7 +348,7 @@ RoomlistModel::addRoom(const QString &room_id, bool suppressInsertNotification)
|
||||
beginInsertRows(QModelIndex(),
|
||||
(int)roomids.size(),
|
||||
(int)(roomids.size() + previewsToAdd.size() -
|
||||
((wasInvite || wasPreview) ? 0 : 1)));
|
||||
((wasInvite || wasPreview) ? 1 : 0)));
|
||||
|
||||
models.insert(room_id, std::move(newRoom));
|
||||
if (wasInvite) {
|
||||
@ -368,7 +368,8 @@ RoomlistModel::addRoom(const QString &room_id, bool suppressInsertNotification)
|
||||
roomids.push_back(std::move(p));
|
||||
}
|
||||
|
||||
if (!suppressInsertNotification && !wasInvite)
|
||||
if (!suppressInsertNotification &&
|
||||
((!wasInvite && !wasPreview) || !previewedRooms.empty()))
|
||||
endInsertRows();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user