Add option to hide posts upvotes and comments points

This commit is contained in:
sartateme
2022-01-31 15:31:00 +01:00
parent 3ef2f004ea
commit 274a8be24e
7 changed files with 29 additions and 1605 deletions

View File

@@ -10,6 +10,7 @@ function resetPreferences(res) {
res.clearCookie('post_media_max_height');
res.clearCookie('collapse_child_comments');
res.clearCookie('show_upvoted_percentage');
res.clearCookie('show_upvotes')
res.clearCookie('subbed_subreddits');
res.clearCookie('domain_twitter');
res.clearCookie('domain_youtube');
@@ -82,6 +83,7 @@ preferenceRoutes.post('/saveprefs', (req, res, next) => {
let post_media_max_height = req.body.post_media_max_height;
let collapse_child_comments = req.body.collapse_child_comments;
let show_upvoted_percentage = req.body.show_upvoted_percentage;
let show_upvotes = req.body.show_upvotes;
let domain_twitter = req.body.domain_twitter;
let domain_youtube = req.body.domain_youtube;
let domain_instagram = req.body.domain_instagram;
@@ -136,6 +138,13 @@ preferenceRoutes.post('/saveprefs', (req, res, next) => {
httpOnly: true,
});
if (show_upvotes === 'on') show_upvotes = 'true';
else show_upvotes = 'false';
res.cookie('show_upvotes', show_upvotes, {
maxAge: 365 * 24 * 60 * 60 * 1000,
httpOnly: true,
});
if (videos_muted === 'on') videos_muted = 'true';
else videos_muted = 'false';
res.cookie('videos_muted', videos_muted, {