Fix an issue caused by viewpoint restoring.

This commit is contained in:
Black Hat 2018-10-13 15:31:31 +08:00
parent 99bf32bf91
commit 0c1a90bf5d
1 changed files with 2 additions and 7 deletions

View File

@ -9,13 +9,8 @@ RoomPanelForm {
if (currentRoom) if (currentRoom)
{ {
var lastScrollPosition = sortedMessageEventModel.mapFromSource(currentRoom.savedTopVisibleIndex()) var lastScrollPosition = sortedMessageEventModel.mapFromSource(currentRoom.savedTopVisibleIndex())
if (lastScrollPosition === 0) console.log("Scrolling to position", lastScrollPosition)
messageListView.positionViewAtEnd() messageListView.currentIndex = lastScrollPosition
else
{
console.log("Scrolling to position", lastScrollPosition)
messageListView.currentIndex = lastScrollPosition
}
if (messageListView.contentY < messageListView.originY + 10 || currentRoom.timelineSize === 0) if (messageListView.contentY < messageListView.originY + 10 || currentRoom.timelineSize === 0)
currentRoom.getPreviousContent(100) currentRoom.getPreviousContent(100)
} }