diff --git a/src-tauri/src/encoding.rs b/src-tauri/src/encoding.rs index 829b71e4..111cfe45 100644 --- a/src-tauri/src/encoding.rs +++ b/src-tauri/src/encoding.rs @@ -1,5 +1,4 @@ -use log::debug; -use mime_guess::{Mime, mime}; +use mime_guess::{mime, Mime}; use std::path::Path; use std::str::FromStr; use tokio::fs; @@ -7,14 +6,8 @@ use tokio::fs; pub async fn read_response_body(body_path: impl AsRef, content_type: &str) -> Option { let body = fs::read(body_path).await.ok()?; let body_charset = parse_charset(content_type).unwrap_or("utf-8".to_string()); - debug!("body_charset: {}", body_charset); if let Some(decoder) = charset::Charset::for_label(body_charset.as_bytes()) { - debug!("Using decoder for charset: {}", body_charset); - let (cow, real_encoding, exist_replace) = decoder.decode(&body); - debug!( - "Decoded body with charset: {}, real_encoding: {:?}, exist_replace: {}", - body_charset, real_encoding, exist_replace - ); + let (cow, _real_encoding, _exist_replace) = decoder.decode(&body); return cow.into_owned().into(); } diff --git a/src-tauri/yaak-license/src/commands.rs b/src-tauri/yaak-license/src/commands.rs index 476d39e7..e848fd8c 100644 --- a/src-tauri/yaak-license/src/commands.rs +++ b/src-tauri/yaak-license/src/commands.rs @@ -1,22 +1,18 @@ use crate::error::Result; use crate::{LicenseCheckStatus, activate_license, check_license, deactivate_license}; -use log::{debug, info}; use tauri::{Runtime, WebviewWindow, command}; #[command] pub async fn check(window: WebviewWindow) -> Result { - debug!("Checking license"); check_license(&window).await } #[command] pub async fn activate(license_key: &str, window: WebviewWindow) -> Result<()> { - info!("Activating license {}", license_key); activate_license(&window, license_key).await } #[command] pub async fn deactivate(window: WebviewWindow) -> Result<()> { - info!("Deactivating activation"); deactivate_license(&window).await } diff --git a/src-tauri/yaak-license/src/license.rs b/src-tauri/yaak-license/src/license.rs index 9f2ab606..2a4b1c56 100644 --- a/src-tauri/yaak-license/src/license.rs +++ b/src-tauri/yaak-license/src/license.rs @@ -67,6 +67,7 @@ pub async fn activate_license( window: &WebviewWindow, license_key: &str, ) -> Result<()> { + info!("Activating license {}", license_key); let client = reqwest::Client::new(); let payload = ActivateLicenseRequestPayload { license_key: license_key.to_string(), @@ -103,6 +104,7 @@ pub async fn activate_license( } pub async fn deactivate_license(window: &WebviewWindow) -> Result<()> { + info!("Deactivating activation"); let app_handle = window.app_handle(); let activation_id = get_activation_id(app_handle).await; @@ -159,8 +161,6 @@ pub async fn check_license(window: &WebviewWindow) -> Result(window: &WebviewWindow) -> Result{check.error}} {activate.error && {activate.error}} + {check.data?.type === 'invalid_license' && ( + + Your license is invalid. Please Sign In for + more details + + )} + {check.data?.type === 'commercial_use' ? ( -