Fix two subscription bugs
This commit is contained in:
parent
2cd35fb3b6
commit
ba42fc066f
4 changed files with 4 additions and 4 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -609,7 +609,7 @@ checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libreddit"
|
name = "libreddit"
|
||||||
version = "0.14.2"
|
version = "0.14.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"askama",
|
"askama",
|
||||||
"async-recursion",
|
"async-recursion",
|
||||||
|
|
|
@ -3,7 +3,7 @@ name = "libreddit"
|
||||||
description = " Alternative private front-end to Reddit"
|
description = " Alternative private front-end to Reddit"
|
||||||
license = "AGPL-3.0"
|
license = "AGPL-3.0"
|
||||||
repository = "https://github.com/spikecodes/libreddit"
|
repository = "https://github.com/spikecodes/libreddit"
|
||||||
version = "0.14.2"
|
version = "0.14.3"
|
||||||
authors = ["spikecodes <19519553+spikecodes@users.noreply.github.com>"]
|
authors = ["spikecodes <19519553+spikecodes@users.noreply.github.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ fn set_cookies_method(req: Request<Body>, remove_cookies: bool) -> Response<Body
|
||||||
|
|
||||||
let mut res = redirect(path);
|
let mut res = redirect(path);
|
||||||
|
|
||||||
for &name in &PREFS {
|
for name in [PREFS.to_vec(), vec!["subscriptions"]].concat() {
|
||||||
match form.get(name) {
|
match form.get(name) {
|
||||||
Some(value) => res.insert_cookie(
|
Some(value) => res.insert_cookie(
|
||||||
Cookie::build(name.to_owned(), value.to_owned())
|
Cookie::build(name.to_owned(), value.to_owned())
|
||||||
|
|
|
@ -199,7 +199,7 @@ pub async fn subscriptions(req: Request<Body>) -> Result<Response<Body>, String>
|
||||||
sub_list.sort_by_key(|a| a.to_lowercase())
|
sub_list.sort_by_key(|a| a.to_lowercase())
|
||||||
} else if action.contains(&"unsubscribe".to_string()) {
|
} else if action.contains(&"unsubscribe".to_string()) {
|
||||||
// Remove sub name from subscribed list
|
// Remove sub name from subscribed list
|
||||||
sub_list.retain(|s| s != part);
|
sub_list.retain(|s| s.to_lowercase() != part.to_lowercase());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue