Fix account bar scrolling when room list filtered
This commit is contained in:
parent
cc4a780865
commit
5373d19c83
|
@ -42,14 +42,16 @@ HListView {
|
||||||
|
|
||||||
property alias filter: filterModel.filter
|
property alias filter: filterModel.filter
|
||||||
readonly property var sectionIndice: {
|
readonly property var sectionIndice: {
|
||||||
const sections = {}
|
const sections = {}
|
||||||
const accounts = ModelStore.get("accounts")
|
let currentUserId = null
|
||||||
let total = 0
|
|
||||||
|
|
||||||
for (let i = 0; i < accounts.count; i++) {
|
for (let i = 0; i < model.filtered.count; i++) {
|
||||||
const userId = accounts.get(i).id
|
const userId = model.filtered.get(i).model.for_account
|
||||||
sections[userId] = total
|
|
||||||
total += ModelStore.get(userId, "rooms").count
|
if (userId !== currentUserId) {
|
||||||
|
sections[userId] = i
|
||||||
|
currentUserId = userId
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return sections
|
return sections
|
||||||
|
|
Loading…
Reference in New Issue
Block a user