Hide NSFW content by default

This commit is contained in:
spikecodes 2021-01-30 21:43:46 -08:00
parent 79027c4c75
commit 1653d4fb4c
No known key found for this signature in database
GPG key ID: 004CECFF9B463BCB
7 changed files with 12 additions and 12 deletions

View file

@ -127,7 +127,7 @@ pub struct Preferences {
pub front_page: String,
pub layout: String,
pub wide: String,
pub hide_nsfw: String,
pub show_nsfw: String,
pub comment_sort: String,
pub subs: Vec<String>,
}
@ -143,7 +143,7 @@ pub fn prefs(req: HttpRequest) -> Preferences {
front_page: cookie(&req, "front_page"),
layout: cookie(&req, "layout"),
wide: cookie(&req, "wide"),
hide_nsfw: cookie(&req, "hide_nsfw"),
show_nsfw: cookie(&req, "show_nsfw"),
comment_sort: cookie(&req, "comment_sort"),
subs: cookie(&req, "subscriptions").split('+').map(String::from).filter(|s| s != "").collect(),
}