Skip to content

Commit 36e5a27

Browse files
committed
page 1 can only next page
1 parent 40b4f19 commit 36e5a27

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

controlers/rss.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ ctrl.rss = async (ctx, next) => {
7272
}
7373
];
7474
if (count < page * limit) kbs.pop();
75-
75+
if (page === 1) kbs.shift();
7676
const feeds = await RSS.getSubscribedFeedsByUserId(userId, limit, page);
7777
if (feeds.length === 0) {
7878
throw new Error('NOT_SUB');
@@ -126,9 +126,8 @@ ctrl.viewAll = async (ctx, next) => {
126126
callback_data: 'VIEWALL_' + (page + 1)
127127
}
128128
];
129-
if (count < page * limit) {
130-
kbs.pop();
131-
}
129+
if (count < page * limit) kbs.pop();
130+
if (page === 1) kbs.shift();
132131
const feeds = await RSS.getAllFeedsWithCount(limit, page);
133132
if (feeds.length === 0) {
134133
throw new Error('NOT_SUB');

0 commit comments

Comments
 (0)