Frontend: Fixed pagination queuing behavior
ci/woodpecker/push/ociImagePush Pipeline was successful
Details
ci/woodpecker/push/ociImagePush Pipeline was successful
Details
This commit is contained in:
parent
ab18633fbc
commit
42bf912bb9
|
@ -82,7 +82,6 @@ import {
|
|||
} from "@/scripts/scroll";
|
||||
import MkButton from "@/components/MkButton.vue";
|
||||
import { magTransProperty } from "@/scripts-mag/mag-util";
|
||||
import { i18n } from "@/i18n";
|
||||
|
||||
export type Paging<
|
||||
E extends keyof misskey.Endpoints = keyof misskey.Endpoints
|
||||
|
@ -296,20 +295,19 @@ const prepend = (item: Item): void => {
|
|||
|
||||
if (isTop) {
|
||||
// Prepend the item
|
||||
items.value.unshift(item);
|
||||
items.value = items.value.slice(0, props.displayLimit);
|
||||
items.value = [item, ...items.value].slice(0, props.displayLimit);
|
||||
} else {
|
||||
if (!queue.value.length) {
|
||||
onScrollTop(rootEl.value, () => {
|
||||
for (const queueItem of queue.value) {
|
||||
prepend(queueItem);
|
||||
}
|
||||
items.value = [
|
||||
...queue.value.reverse(),
|
||||
...items.value,
|
||||
].slice(0, props.displayLimit);
|
||||
queue.value = [];
|
||||
});
|
||||
}
|
||||
|
||||
queue.value.push(item);
|
||||
queue.value = queue.value.slice(0, props.displayLimit);
|
||||
queue.value = [...queue.value, item].slice(-props.displayLimit);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue