Fix two subscription bugs

pull/223/head v0.14.3
spikecodes 2 years ago
parent 2cd35fb3b6
commit ba42fc066f
No known key found for this signature in database
GPG Key ID: 004CECFF9B463BCB
  1. 2
      Cargo.lock
  2. 2
      Cargo.toml
  3. 2
      src/settings.rs
  4. 2
      src/subreddit.rs

2
Cargo.lock generated

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

@ -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"

@ -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())

@ -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());
}
}

Loading…
Cancel
Save