Skip to content

Node.js based forum software built for the modern web

use same settings for spiders

Barış Soner Uşaklıfcc04ef376fa
diff --git a/src/user/settings.js b/src/user/settings.js
index 6f560e58f7..9d8c92fdc3 100644
--- a/src/user/settings.js
+++ b/src/user/settings.js
@@ -10,11 +10,16 @@ const notifications = require('../notifications');
const languages = require('../languages');
module.exports = function (User) {
+ const spiderDefaultSettings = {
+ usePagination: 1,
+ topicPostSort: 'oldest_to_newest',
+ postsPerPage: 20,
+ topicsPerPage: 20,
+ };
User.getSettings = async function (uid) {
if (parseInt(uid, 10) <= 0) {
- return await onSettingsLoaded(uid, {
- usePagination: parseInt(uid, 10) === -1 ? 1 : undefined, // force spiders to use pagination
- });
+ const isSpider = parseInt(uid, 10) === -1;
+ return await onSettingsLoaded(uid, isSpider ? spiderDefaultSettings : {});
}
let settings = await db.getObject(`user:${uid}:settings`);
settings = settings || {};