Frontend: Fixed prepending items when fresh and full
ci/woodpecker/push/ociImagePush Pipeline was successful
Details
ci/woodpecker/push/ociImagePush Pipeline was successful
Details
This commit is contained in:
parent
8aa2a4dac4
commit
5666bb4622
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue