fix: switch inf. scroll to xhr (#9854)

this fixes infinitescroll when url has custom query parameters
also fixes infinitescroll for plugins like QnA
fixes infinitescroll on tags page
deprecate topics.loadMoreSortedTopics
deprecate topics.loadMoreFromSet
This commit is contained in:
Barış Soner Uşaklı
2021-10-02 13:35:58 -04:00
committed by GitHub
parent cb25faaa2d
commit 4404e81991
3 changed files with 12 additions and 31 deletions

View File

@@ -1,5 +1,7 @@
'use strict';
const winston = require('winston');
const topics = require('../../topics');
const privileges = require('../../privileges');
const meta = require('../../meta');
@@ -62,6 +64,7 @@ module.exports = function (SocketTopics) {
};
SocketTopics.loadMoreSortedTopics = async function (socket, data) {
winston.warn('[deprecated] use infinitescroll.loadMoreXhr'); // TODO: remove in 1.19.0
if (!data || !utils.isNumber(data.after) || parseInt(data.after, 10) < 0) {
throw new Error('[[error:invalid-data]]');
}
@@ -85,6 +88,7 @@ module.exports = function (SocketTopics) {
};
SocketTopics.loadMoreFromSet = async function (socket, data) {
winston.warn('[deprecated] use infinitescroll.loadMoreXhr'); // TODO: remove in 1.19.0
if (!data || !utils.isNumber(data.after) || parseInt(data.after, 10) < 0 || !data.set) {
throw new Error('[[error:invalid-data]]');
}