Lokale Änderungen vor Neuinstallation sichern
All checks were successful
Build AppImage / build (push) Has been skipped
All checks were successful
Build AppImage / build (push) Has been skipped
This commit is contained in:
parent
93a97b44b0
commit
0219debab3
2 changed files with 1515 additions and 0 deletions
1491
Fehler.txt
Normal file
1491
Fehler.txt
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -158,6 +158,30 @@ pub async fn set_claude_session_id(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Claude Session-ID zurücksetzen (für Kontext-Reset)
|
||||
/// Die nächste Nachricht startet dann eine neue Claude-Session ohne --resume
|
||||
#[tauri::command]
|
||||
pub async fn reset_claude_session(
|
||||
app: AppHandle,
|
||||
) -> Result<String, String> {
|
||||
let state = app.state::<Arc<Mutex<db::Database>>>();
|
||||
let db = state.lock().unwrap();
|
||||
|
||||
if let Ok(Some(id)) = db.get_setting("active_session_id") {
|
||||
if !id.is_empty() {
|
||||
if let Ok(Some(mut session)) = db.get_session(&id) {
|
||||
let old_id = session.claude_session_id.clone().unwrap_or_default();
|
||||
session.claude_session_id = None;
|
||||
db.update_session(&session).map_err(|e| e.to_string())?;
|
||||
println!("🔄 Claude Session-ID zurückgesetzt für '{}' (war: {})", session.title, old_id);
|
||||
return Ok(session.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Err("Keine aktive Session gefunden".to_string())
|
||||
}
|
||||
|
||||
/// Aktualisiert nur die Statistiken einer Session (Token, Kosten, Message-Count)
|
||||
#[tauri::command]
|
||||
pub async fn update_session_stats(
|
||||
|
|
|
|||
Loading…
Reference in a new issue