feat: Implement server-side comment preloading for improved performance and introduce new comment features including pinned comments, locked threads, and custom emojis.
This commit is contained in:
@@ -105,6 +105,16 @@ export default (router, tpl) => {
|
||||
|
||||
if (mode === 'item') {
|
||||
data.hidePagination = true;
|
||||
if (req.session) {
|
||||
data.comments = await f0cklib.getComments(req.params.itemid);
|
||||
const sub = await f0cklib.getSubscriptionStatus(req.session.id, req.params.itemid);
|
||||
data.isSubscribed = sub;
|
||||
data.commentsJSON = Buffer.from(JSON.stringify(data.comments || [])).toString('base64');
|
||||
} else {
|
||||
data.comments = [];
|
||||
data.isSubscribed = false;
|
||||
data.commentsJSON = Buffer.from('[]').toString('base64');
|
||||
}
|
||||
}
|
||||
|
||||
return res.reply({ body: tpl.render(mode, data, req) });
|
||||
|
||||
Reference in New Issue
Block a user