Fix higlighted room not updating after ctrl+tab
This commit is contained in:
parent
922f12e9f9
commit
200f0c33a8
|
@ -106,7 +106,7 @@ HListView {
|
|||
function setCorrectCurrentItem() {
|
||||
if (! currentShouldBeRoom && ! currentShouldBeAccount) {
|
||||
currentIndex = -1
|
||||
return
|
||||
return null
|
||||
}
|
||||
|
||||
for (let i = 0; i < model.count; i++) {
|
||||
|
@ -124,12 +124,21 @@ 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
|
||||
// arrive in the model, try to find it until then.
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user