Notification and pagination bugfixes

This commit is contained in:
Natty 2024-04-05 23:22:22 +02:00
parent 014b394f66
commit 8618b2084d
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
3 changed files with 17 additions and 9 deletions

View File

@ -49,6 +49,7 @@
</template> </template>
<XNotificationGroup <XNotificationGroup
v-else-if="notificationGroup.type === 'group'" v-else-if="notificationGroup.type === 'group'"
:key="'group' + notificationGroup.id"
:notificationGroup="notificationGroup" :notificationGroup="notificationGroup"
:with-time="true" :with-time="true"
:full="true" :full="true"

View File

@ -297,11 +297,12 @@ const prepend = (item: PageItem): void => {
} else { } else {
if (!queue.value.length) { if (!queue.value.length) {
onScrollTop(rootEl.value, () => { onScrollTop(rootEl.value, () => {
items.value = [ const queueRemoved = [...queue.value].reverse();
...queue.value.reverse(),
...items.value,
].slice(0, props.displayLimit);
queue.value = []; queue.value = [];
items.value = [...queueRemoved, ...items.value].slice(
0,
props.displayLimit
);
}); });
} }

View File

@ -300,13 +300,19 @@ const prepend = (item: Item): void => {
// Prepend the item // Prepend the item
items.value = [item, ...items.value].slice(0, props.displayLimit); items.value = [item, ...items.value].slice(0, props.displayLimit);
} else { } else {
if (!queue.value.length && rootEl.value) { if (!rootEl.value) {
items.value.unshift(item);
return;
}
if (!queue.value.length) {
onScrollTop(rootEl.value, () => { onScrollTop(rootEl.value, () => {
items.value = [ const queueRemoved = [...queue.value].reverse();
...queue.value.reverse(),
...items.value,
].slice(0, props.displayLimit);
queue.value = []; queue.value = [];
items.value = [...queueRemoved, ...items.value].slice(
0,
props.displayLimit
);
}); });
} }