refactor: 优化代码结构并修复多个问题

修复 ruleComponent.tsx 和 ruleBuilderUtils.ts 中 queryToAutoScoreRule 函数的参数问题
调整 database.rs 中 state_guard 的 drop 位置
优化 EventEmitter 和 Context 中的 once 方法实现
移除 Sidebar.tsx 和 OOBE.tsx 中未使用的代码
格式化 MCP 使用文档和规则文件
This commit is contained in:
Yukino_fox
2026-03-22 19:26:35 +08:00
parent 63dda3e043
commit 5be6bd09d2
11 changed files with 26 additions and 31 deletions
+1 -1
View File
@@ -1061,7 +1061,6 @@ pub async fn db_switch_connection(
Some("database"),
None,
);
drop(state_guard);
let (db_type, saved_connection_string, saved_status, conn) = if connection_string
.starts_with("postgres://")
@@ -1170,6 +1169,7 @@ pub async fn db_switch_connection(
conn,
)
};
drop(state_guard);
{
let settings_db_path = sqlite_db_path(&app_handle)?;