fix: account for closing notifs in group preview
This commit is contained in:
parent
ac65b78588
commit
7a82ca4765
1 changed files with 15 additions and 1 deletions
|
|
@ -36,7 +36,21 @@ LazyListView {
|
|||
}
|
||||
|
||||
model: ScriptModel {
|
||||
values: root.expanded ? root.notifs : root.notifs.slice(0, Config.notifs.groupPreviewNum + 1)
|
||||
values: {
|
||||
if (root.expanded)
|
||||
return root.notifs;
|
||||
|
||||
let count = 0;
|
||||
let i = 0;
|
||||
const previewNum = Config.notifs.groupPreviewNum + 1;
|
||||
while (i < root.notifs.length && count < previewNum) {
|
||||
if (!(root.notifs[i]?.closed ?? true))
|
||||
count++;
|
||||
i++;
|
||||
}
|
||||
|
||||
return root.notifs.slice(0, i);
|
||||
}
|
||||
}
|
||||
|
||||
delegate: Component {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue