summaryrefslogtreecommitdiff
path: root/src/client/scripts/paging.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/scripts/paging.ts')
-rw-r--r--src/client/scripts/paging.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/scripts/paging.ts b/src/client/scripts/paging.ts
index bcb0d7f2b0..194c2e8003 100644
--- a/src/client/scripts/paging.ts
+++ b/src/client/scripts/paging.ts
@@ -94,7 +94,11 @@ export default (opts) => ({
for (let i = 0; i < items.length; i++) {
const item = items[i];
markRaw(item);
- if (i === 3) item._shouldInsertAd_ = true;
+ if (this.pagination.reversed) {
+ if (i === items.length - 2) item._shouldInsertAd_ = true;
+ } else {
+ if (i === 3) item._shouldInsertAd_ = true;
+ }
}
if (!this.pagination.noPaging && (items.length > (this.pagination.limit || 10))) {
items.pop();
@@ -133,7 +137,11 @@ export default (opts) => ({
for (let i = 0; i < items.length; i++) {
const item = items[i];
markRaw(item);
- if (i === 10) item._shouldInsertAd_ = true;
+ if (this.pagination.reversed) {
+ if (i === items.length - 9) item._shouldInsertAd_ = true;
+ } else {
+ if (i === 10) item._shouldInsertAd_ = true;
+ }
}
if (items.length > SECOND_FETCH_LIMIT) {
items.pop();