Highlight index 1 when filtering rooms
This commit is contained in:
parent
f20853b7ad
commit
631e2bc107
2
TODO.md
2
TODO.md
|
@ -1,7 +1,5 @@
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
- better initial highlight position when filtering
|
|
||||||
|
|
||||||
- fix python getting stuck when loading large room
|
- fix python getting stuck when loading large room
|
||||||
- fix accounts in room list not getting their profile updated if mirage starts
|
- fix accounts in room list not getting their profile updated if mirage starts
|
||||||
with a filter
|
with a filter
|
||||||
|
|
|
@ -46,13 +46,19 @@ HListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
onFilterChanged: {
|
onFilterChanged: {
|
||||||
py.callCoro("set_substring_filter", ["all_rooms", filter])
|
py.callCoro("set_substring_filter", ["all_rooms", filter], () => {
|
||||||
|
if (filter) {
|
||||||
|
currentIndex = 1 // highlight the first matching room
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const item = model.get(currentIndex)
|
const item = model.get(currentIndex)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
! filter &&
|
! filter &&
|
||||||
item && ((
|
item && (
|
||||||
|
currentIndex === 1 || // required, related to the if above
|
||||||
|
(
|
||||||
currentShouldBeAccount &&
|
currentShouldBeAccount &&
|
||||||
wantedUserId !== item.id
|
wantedUserId !== item.id
|
||||||
) || (
|
) || (
|
||||||
|
@ -60,9 +66,11 @@ HListView {
|
||||||
wantedUserId !== item.for_account ||
|
wantedUserId !== item.for_account ||
|
||||||
wantedRoomId !== item.id
|
wantedRoomId !== item.id
|
||||||
)
|
)
|
||||||
))
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
currentIndex = -1 // will trigger the correctTimer
|
currentIndex = -1 // will trigger the correctTimer
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user