From be5d96a65c7b7d6c83aa5285c7ad83ec622d89c8 Mon Sep 17 00:00:00 2001 From: rain9 <15911122312@163.com> Date: Mon, 5 Jan 2026 11:06:07 +0800 Subject: [PATCH] chore: update --- src-tauri/src/lib.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 9c52fde2..506ab0d6 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -402,16 +402,13 @@ async fn show_settings(app_handle: AppHandle) { async fn show_view_extension( app_handle: AppHandle, label: Option, - query: Option, + query: String, width: Option, height: Option, title: Option, ) -> Result<(), String> { log::debug!("view extension menu item was clicked"); - if query - .as_ref() - .map_or(true, |q| !(q.contains("manual=1") && q.contains("ext="))) - { + if !(query.contains("manual=1") && query.contains("ext=")) { log::error!("Invalid query for view extension: manual=1 and ext= required"); return Err("invalid argument: manual=1 and ext= should be provided".into()); } @@ -425,7 +422,7 @@ async fn show_view_extension( } // If window doesn't exist (e.g. was closed), create it - let url_suffix = query.unwrap_or_else(|| "".to_string()); + let url_suffix = query; let url = WebviewUrl::App(format!("/ui/view-extension{}", url_suffix).into()); let w = width.unwrap_or(1000.0); let h = height.unwrap_or(800.0);