diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-07-13 02:57:16 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-07-13 02:57:16 +0200 |
commit | 0a4e95a1db11c45e3880eee4982753a9faf0a3da (patch) | |
tree | 11fa6b355133bd7df2d259d32e0f447126bb722c /src/timeline | |
parent | Try to fix crash in setCurrentIndex (diff) | |
download | nheko-0a4e95a1db11c45e3880eee4982753a9faf0a3da.tar.xz |
Don't allow switching to current room
fixes #634
Diffstat (limited to 'src/timeline')
-rw-r--r-- | src/timeline/RoomlistModel.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/timeline/RoomlistModel.cpp b/src/timeline/RoomlistModel.cpp index 1c1057e1..cb800699 100644 --- a/src/timeline/RoomlistModel.cpp +++ b/src/timeline/RoomlistModel.cpp @@ -602,6 +602,10 @@ RoomlistModel::leave(QString roomid) void RoomlistModel::setCurrentRoom(QString roomid) { + if ((currentRoom_ && currentRoom_->roomId() == roomid) || + (currentRoomPreview_ && currentRoomPreview_->roomid() == roomid)) + return; + nhlog::ui()->debug("Trying to switch to: {}", roomid.toStdString()); if (models.contains(roomid)) { currentRoom_ = models.value(roomid); |