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