Fix two subscription bugs

This commit is contained in:
spikecodes 2021-05-19 20:30:10 -07:00
parent 2cd35fb3b6
commit ba42fc066f
No known key found for this signature in database
GPG Key ID: 004CECFF9B463BCB
4 changed files with 4 additions and 4 deletions

2
Cargo.lock generated
View File

@ -609,7 +609,7 @@ checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e"
[[package]]
name = "libreddit"
version = "0.14.2"
version = "0.14.3"
dependencies = [
"askama",
"async-recursion",

View File

@ -3,7 +3,7 @@ name = "libreddit"
description = " Alternative private front-end to Reddit"
license = "AGPL-3.0"
repository = "https://github.com/spikecodes/libreddit"
version = "0.14.2"
version = "0.14.3"
authors = ["spikecodes <19519553+spikecodes@users.noreply.github.com>"]
edition = "2018"

View File

@ -103,7 +103,7 @@ fn set_cookies_method(req: Request<Body>, remove_cookies: bool) -> Response<Body
let mut res = redirect(path);
for &name in &PREFS {
for name in [PREFS.to_vec(), vec!["subscriptions"]].concat() {
match form.get(name) {
Some(value) => res.insert_cookie(
Cookie::build(name.to_owned(), value.to_owned())

View File

@ -199,7 +199,7 @@ pub async fn subscriptions(req: Request<Body>) -> Result<Response<Body>, String>
sub_list.sort_by_key(|a| a.to_lowercase())
} else if action.contains(&"unsubscribe".to_string()) {
// Remove sub name from subscribed list
sub_list.retain(|s| s != part);
sub_list.retain(|s| s.to_lowercase() != part.to_lowercase());
}
}