Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: colour scheme not persisting & incorrect initialization #52

Merged
merged 4 commits into from May 16, 2024

Conversation

neil-lobo
Copy link
Contributor

@neil-lobo neil-lobo commented Apr 26, 2024

Fixed Issues:

  1. After changing your colour scheme and restarting the application, your colour scheme would not persist.
  2. The selection ring around the currently selected colour scheme was being incorrectly applied
  3. Initialization of colour scheme was incorrect

Cause 1:

After the client sends a POST request to this endpoint

#[post("/api/user-config")]
pub async fn handle_update_user_config(user_cfg: web::Json<config::UserConfig>) -> Result<impl Responder> {
let result = config::update_user_config(user_cfg.0);
Ok(web::Json(result))
}

the payload is deserialized incorrectly due to missing field color_scheme in the UserConfig struct:
#[derive(Debug, Serialize, Deserialize)]
pub struct UserConfig {
pub threads: i32,
pub theme: String,
pub update_interval: u64,
pub last_sync_time: String,
pub local_proxy: Option<LocalProxy>,
pub customize_style: CustomizeStyle,
pub purge_on_days: u64,
pub purge_unread_articles: bool
}

resulting in colour scheme information not being saved.

@neil-lobo neil-lobo force-pushed the neil/fix/persist-colour-scheme branch from 1401e2d to a2b4a34 Compare April 26, 2024 06:51
@zhanglun zhanglun merged commit 9c231be into zhanglun:master May 16, 2024
@zhanglun
Copy link
Owner

thank you

@neil-lobo neil-lobo deleted the neil/fix/persist-colour-scheme branch May 16, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants