From 1f6f5d621d056d19b15db020952d38d071452719 Mon Sep 17 00:00:00 2001 From: redmt Date: Sat, 11 Jun 2022 19:35:27 +0200 Subject: [PATCH] Update user.js to pass instance_config to template --- routes/user.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/routes/user.js b/routes/user.js index 6dd87f7..eb383b7 100644 --- a/routes/user.js +++ b/routes/user.js @@ -94,6 +94,7 @@ userRoutes.get('/u/:user/:kind?', (req, res, next) => { return res.render('frontpage', { json: null, user_preferences: req.cookies, + instance_config: config, }); } if (json) { @@ -126,6 +127,7 @@ userRoutes.get('/u/:user/:kind?', (req, res, next) => { sortby: sortby, past: past, user_preferences: req.cookies, + instance_config: config, }); } })(); @@ -166,6 +168,7 @@ userRoutes.get('/u/:user/:kind?', (req, res, next) => { return res.render('frontpage', { post: null, user_preferences: req.cookies, + instance_config: config, }); } else { (async () => { @@ -196,6 +199,7 @@ userRoutes.get('/u/:user/:kind?', (req, res, next) => { sortby: sortby, past: past, user_preferences: req.cookies, + instance_config: config, }); } })(); @@ -212,6 +216,7 @@ userRoutes.get('/u/:user/:kind?', (req, res, next) => { json: null, http_status_code: result.status, user_preferences: req.cookies, + instance_config: config, }); } }) @@ -224,6 +229,7 @@ userRoutes.get('/u/:user/:kind?', (req, res, next) => { json: null, http_status_code: result.status, user_preferences: req.cookies, + instance_config: config, }); }); }); @@ -241,6 +247,7 @@ userRoutes.get('/u/:user/:kind?', (req, res, next) => { http_status_code: result.status, http_statustext: result.statusText, user_preferences: req.cookies, + instance_config: config, }); } }) @@ -314,6 +321,7 @@ userRoutes.get('/u/:user/m/:custom_feed/:sort?', (req, res, next) => { return res.render('frontpage', { json: null, user_preferences: req.cookies, + instance_config: config, }); } if (json) { @@ -350,6 +358,7 @@ userRoutes.get('/u/:user/m/:custom_feed/:sort?', (req, res, next) => { redis_key: key, after: req.query.after, before: req.query.before, + instance_config: config, }); } else { return res.render('subreddit', { @@ -357,6 +366,7 @@ userRoutes.get('/u/:user/m/:custom_feed/:sort?', (req, res, next) => { error: true, data: processed_json, user_preferences: req.cookies, + instance_config: config, }); } } @@ -384,6 +394,7 @@ userRoutes.get('/u/:user/m/:custom_feed/:sort?', (req, res, next) => { return res.render('subreddit', { json: null, user_preferences: req.cookies, + instance_config: config, }); } else { console.log( @@ -420,6 +431,7 @@ userRoutes.get('/u/:user/m/:custom_feed/:sort?', (req, res, next) => { redis_key: key, after: req.query.after, before: req.query.before, + instance_config: config, }); } })(); @@ -440,6 +452,7 @@ userRoutes.get('/u/:user/m/:custom_feed/:sort?', (req, res, next) => { json: null, http_status_code: result.status, user_preferences: req.cookies, + instance_config: config, }); } })