Skip to content

Node.js based forum software built for the modern web

only send noscript paginator data on cold loads

psychobunnya52c69d2a158
diff --git a/src/controllers/categories.js b/src/controllers/categories.js
index b23e4d4afb..d3b4291cd8 100644
--- a/src/controllers/categories.js
+++ b/src/controllers/categories.js
@@ -202,13 +202,15 @@ categoriesController.get = function(req, res, next) {
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
data.csrf = req.csrfToken();
- // Paginator for noscript
- data.pages = [];
- for(var x=1;x<=data.pageCount;x++) {
- data.pages.push({
- page: x,
- active: x === parseInt(page, 10)
- });
+ if (!res.locals.isAPI) {
+ // Paginator for noscript
+ data.pages = [];
+ for(var x=1;x<=data.pageCount;x++) {
+ data.pages.push({
+ page: x,
+ active: x === parseInt(page, 10)
+ });
+ }
}
res.render('category', data);
diff --git a/src/controllers/topics.js b/src/controllers/topics.js
index de91eb75dd..5bae5b3e42 100644
--- a/src/controllers/topics.js
+++ b/src/controllers/topics.js
@@ -217,13 +217,15 @@ topicsController.get = function(req, res, next) {
topic_url += '?' + queryString;
}
- // Paginator for noscript
- data.pages = [];
- for(var x=1; x<=data.pageCount; x++) {
- data.pages.push({
- page: x,
- active: x === parseInt(page, 10)
- });
+ if (!res.locals.isAPI) {
+ // Paginator for noscript
+ data.pages = [];
+ for(var x=1; x<=data.pageCount; x++) {
+ data.pages.push({
+ page: x,
+ active: x === parseInt(page, 10)
+ });
+ }
}
res.render('topic', data);