From 86d60496c0be21ce19a7d4528a1720cf01adcb56 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 12 May 2021 18:28:39 +0200 Subject: [PATCH] Don't move read rooms to lower sorting position --- .../session/leftpanel/RoomTileViewModel.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/domain/session/leftpanel/RoomTileViewModel.js b/src/domain/session/leftpanel/RoomTileViewModel.js index fe199ff1..eebea618 100644 --- a/src/domain/session/leftpanel/RoomTileViewModel.js +++ b/src/domain/session/leftpanel/RoomTileViewModel.js @@ -17,16 +17,11 @@ limitations under the License. import {BaseTileViewModel} from "./BaseTileViewModel.js"; -function isSortedAsUnread(vm) { - return vm.isUnread || (vm.isOpen && vm._wasUnreadWhenOpening); -} - export class RoomTileViewModel extends BaseTileViewModel { constructor(options) { super(options); const {room} = options; this._room = room; - this._wasUnreadWhenOpening = false; this._url = this.urlCreator.openRoomActionUrl(this._room.id); } @@ -57,12 +52,6 @@ export class RoomTileViewModel extends BaseTileViewModel { } return -1; } - if (isSortedAsUnread(this) !== isSortedAsUnread(other)) { - if (isSortedAsUnread(this)) { - return -1; - } - return 1; - } const myTimestamp = myRoom.lastMessageTimestamp; const theirTimestamp = theirRoom.lastMessageTimestamp; const myTimestampValid = Number.isSafeInteger(myTimestamp); @@ -105,10 +94,4 @@ export class RoomTileViewModel extends BaseTileViewModel { get _avatarSource() { return this._room; } - - open() { - if (super.open()) { - this._wasUnreadWhenOpening = this._room.isUnread; - } - } }