fixed scroll

This commit is contained in:
Akif9748 2022-08-31 15:21:04 +03:00
parent 71f820160d
commit e2e2b5bf59
2 changed files with 1 additions and 2 deletions

View file

@ -2,7 +2,6 @@ const UserModel = require("./User");
const UserCache = [];
module.exports.getAuthor = async function () {
console.log("User Cache Length:", UserCache.length);
const id = this.authorID || this.author?.id;
let user = UserCache.find(user => user?.id == id)
if (!user) {

View file

@ -36,7 +36,7 @@ app.get("/:id/", async (req, res) => {
.replaceAll("\n", "<br>");
return await message.get_author();
})));
res.reply("thread", { page, thread, messages, scroll: req.query.scroll || thread.messages[0].id });
res.reply("thread", { page, thread, messages, scroll: req.query.scroll || messages[0]?.id });
thread.save();