fix(@desktop/chat): incorrect timestamp evaluation

This commit is contained in:
Andrei Smirnov 2021-07-23 11:23:58 +03:00 committed by Iuri Matias
parent 0455bcdcf1
commit 79db861d2f
2 changed files with 3 additions and 12 deletions

View File

@ -305,10 +305,11 @@ Item {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
clip: true clip: true
currentIndex: chatsModel.messageView.getMessageListIndex(chatsModel.channelView.activeChannelIndex)
Repeater { Repeater {
model: chatsModel.messageView model: chatsModel.messageView
Loader { Loader {
active: false active: stackLayoutChatMessages.currentIndex === index
sourceComponent: ChatMessages { sourceComponent: ChatMessages {
messageList: model.messages messageList: model.messages
currentTime: chatColumnLayout.currentTime currentTime: chatColumnLayout.currentTime
@ -318,16 +319,6 @@ Item {
} }
} }
} }
Connections {
target: chatsModel.channelView
onActiveChannelChanged: {
stackLayoutChatMessages.currentIndex = chatsModel.messageView.getMessageListIndex(chatsModel.channelView.activeChannelIndex)
if(stackLayoutChatMessages.currentIndex > -1 && !stackLayoutChatMessages.children[stackLayoutChatMessages.currentIndex].active){
stackLayoutChatMessages.children[stackLayoutChatMessages.currentIndex].active = true;
}
}
}
} }
Connections { Connections {

View File

@ -329,7 +329,7 @@ SplitView {
return -1; return -1;
} }
nextMessageIndex: { nextMessageIndex: {
if (msgDelegate.DelegateModel.itemsIndex <= 1) { if (msgDelegate.DelegateModel.itemsIndex < 1) {
return -1 return -1
} }
return messageListDelegate.items.get(msgDelegate.DelegateModel.itemsIndex - 1).model.index return messageListDelegate.items.get(msgDelegate.DelegateModel.itemsIndex - 1).model.index