Frontend: Fixed prepending items when fresh and full
ci/woodpecker/push/ociImagePush Pipeline was successful Details

This commit is contained in:
Natty 2024-11-25 19:39:05 +01:00
parent 8aa2a4dac4
commit 5666bb4622
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
1 changed files with 4 additions and 6 deletions

View File

@ -197,7 +197,7 @@ const refresh = async (): Promise<void> => {
for (let i = 0; i < res.length; i++) {
const item = res[i];
if (!updateItem(item.id, (old) => item)) {
append(item);
prepend(item);
}
ids.delete(item.id);
}
@ -314,9 +314,7 @@ const prepend = (item: Item): void => {
if (!queue.value.length) {
(props.pagination.reversed ? onScrollBottom : onScrollTop)(
rootEl.value,
() => {
nextTick(unqueue);
}
unqueue
);
}
@ -325,11 +323,11 @@ const prepend = (item: Item): void => {
return;
}
if (items.value.length > props.displayLimit) {
queue.value = [...queue.value, item].slice(-props.displayLimit);
if (items.value.length >= props.displayLimit) {
if (!queue.value.length) {
nextTick(unqueue);
}
queue.value = [...queue.value, item].slice(-props.displayLimit);
return;
}