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>
<XNotificationGroup
v-else-if="notificationGroup.type === 'group'"
:key="'group' + notificationGroup.id"
:notificationGroup="notificationGroup"
:with-time="true"
:full="true"

View File

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