Fix higlighted room not updating after ctrl+tab

This commit is contained in:
miruka 2020-05-13 22:47:04 -04:00
parent 922f12e9f9
commit 200f0c33a8
2 changed files with 15 additions and 2 deletions

View File

@ -106,7 +106,7 @@ HListView {
function setCorrectCurrentItem() {
if (! currentShouldBeRoom && ! currentShouldBeAccount) {
currentIndex = -1
return
return null
}
for (let i = 0; i < model.count; i++) {
@ -124,11 +124,20 @@ HListView {
item.for_account === wantedUserId
)) {
currentIndex = i
return
}
return true
}
}
return false
}
Connections {
target: pageLoader
onPreviousShown:
// Will trigger the timer above if item isn't found
if (setCorrectCurrentItem() === false) currentIndex = -1
}
Timer {
// On startup, the account/room takes an unknown amount of time to

View File

@ -33,6 +33,9 @@ HLoader {
}
signal previousShown(string componentUrl, var properties)
property bool isWide: width > theme.contentIsWideAbove
// List of previously loaded [componentUrl, {properties}]
@ -79,6 +82,7 @@ HLoader {
window.uiState.page = componentUrl
window.uiState.pageProperties = properties
window.uiStateChanged()
previousShown(componentUrl, properties)
return true
}