feat: support minimizing window to tray on close (#41)
fix: grant set_skip_taskbar permission through default capability chore: align settings casing and defaults between Rust and frontend Co-authored-by: Jason <farion1231@gmail.com>
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
use std::collections::HashMap;
|
||||
use tauri::State;
|
||||
use tauri_plugin_opener::OpenerExt;
|
||||
use tauri_plugin_dialog::DialogExt;
|
||||
use tauri_plugin_opener::OpenerExt;
|
||||
|
||||
use crate::app_config::AppType;
|
||||
use crate::codex_config;
|
||||
@@ -655,9 +655,8 @@ pub async fn open_app_config_folder(handle: tauri::AppHandle) -> Result<bool, St
|
||||
|
||||
/// 获取设置
|
||||
#[tauri::command]
|
||||
pub async fn get_settings() -> Result<serde_json::Value, String> {
|
||||
serde_json::to_value(crate::settings::get_settings())
|
||||
.map_err(|e| format!("序列化设置失败: {}", e))
|
||||
pub async fn get_settings() -> Result<crate::settings::AppSettings, String> {
|
||||
Ok(crate::settings::get_settings())
|
||||
}
|
||||
|
||||
/// 保存设置
|
||||
@@ -697,11 +696,17 @@ pub async fn is_portable_mode() -> Result<bool, String> {
|
||||
#[tauri::command]
|
||||
pub async fn get_vscode_settings_status() -> Result<ConfigStatus, String> {
|
||||
if let Some(p) = vscode::find_existing_settings() {
|
||||
Ok(ConfigStatus { exists: true, path: p.to_string_lossy().to_string() })
|
||||
Ok(ConfigStatus {
|
||||
exists: true,
|
||||
path: p.to_string_lossy().to_string(),
|
||||
})
|
||||
} else {
|
||||
// 默认返回 macOS 稳定版路径(或其他平台首选项的第一个候选),但标记不存在
|
||||
let preferred = vscode::candidate_settings_paths().into_iter().next();
|
||||
Ok(ConfigStatus { exists: false, path: preferred.unwrap_or_default().to_string_lossy().to_string() })
|
||||
Ok(ConfigStatus {
|
||||
exists: false,
|
||||
path: preferred.unwrap_or_default().to_string_lossy().to_string(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user