fix(desktop): passar ticket_ref em todas as chamadas open_chat_window
- Adicionar ticket_ref ao comando Tauri open_chat_window - Passar ticket_ref nas chamadas do tray menu - Usar 0 como fallback para deeplinks 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
d20ebf7416
commit
1249b4ec26
1 changed files with 7 additions and 7 deletions
|
|
@ -329,8 +329,8 @@ async fn upload_chat_file(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
fn open_chat_window(app: tauri::AppHandle, ticket_id: String) -> Result<(), String> {
|
fn open_chat_window(app: tauri::AppHandle, ticket_id: String, ticket_ref: u64) -> Result<(), String> {
|
||||||
chat::open_chat_window(&app, &ticket_id)
|
chat::open_chat_window(&app, &ticket_id, ticket_ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
|
|
@ -394,8 +394,8 @@ fn handle_deep_link(app: &tauri::AppHandle, url: &str) {
|
||||||
let ticket_id = parts[1].split('?').next().unwrap_or(parts[1]);
|
let ticket_id = parts[1].split('?').next().unwrap_or(parts[1]);
|
||||||
log_info!("Abrindo chat do ticket: {ticket_id}");
|
log_info!("Abrindo chat do ticket: {ticket_id}");
|
||||||
|
|
||||||
// Abre janela de chat
|
// Abre janela de chat (ticket_ref 0 quando vem de deeplink)
|
||||||
if let Err(e) = chat::open_chat_window(app, ticket_id) {
|
if let Err(e) = chat::open_chat_window(app, ticket_id, 0) {
|
||||||
log_error!("Falha ao abrir chat: {e}");
|
log_error!("Falha ao abrir chat: {e}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -581,7 +581,7 @@ fn setup_tray(app: &tauri::AppHandle) -> tauri::Result<()> {
|
||||||
if let Some(chat_runtime) = tray.app_handle().try_state::<ChatRuntime>() {
|
if let Some(chat_runtime) = tray.app_handle().try_state::<ChatRuntime>() {
|
||||||
let sessions = chat_runtime.get_sessions();
|
let sessions = chat_runtime.get_sessions();
|
||||||
if let Some(session) = sessions.first() {
|
if let Some(session) = sessions.first() {
|
||||||
let _ = chat::open_chat_window(tray.app_handle(), &session.ticket_id);
|
let _ = chat::open_chat_window(tray.app_handle(), &session.ticket_id, session.ticket_ref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -590,7 +590,7 @@ fn setup_tray(app: &tauri::AppHandle) -> tauri::Result<()> {
|
||||||
if let Some(chat_runtime) = tray.app_handle().try_state::<ChatRuntime>() {
|
if let Some(chat_runtime) = tray.app_handle().try_state::<ChatRuntime>() {
|
||||||
let sessions = chat_runtime.get_sessions();
|
let sessions = chat_runtime.get_sessions();
|
||||||
if let Some(session) = sessions.first() {
|
if let Some(session) = sessions.first() {
|
||||||
if let Err(e) = chat::open_chat_window(tray.app_handle(), &session.ticket_id) {
|
if let Err(e) = chat::open_chat_window(tray.app_handle(), &session.ticket_id, session.ticket_ref) {
|
||||||
log_error!("Falha ao abrir janela de chat: {e}");
|
log_error!("Falha ao abrir janela de chat: {e}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -612,7 +612,7 @@ fn setup_tray(app: &tauri::AppHandle) -> tauri::Result<()> {
|
||||||
if let Some(chat_runtime) = tray.app_handle().try_state::<ChatRuntime>() {
|
if let Some(chat_runtime) = tray.app_handle().try_state::<ChatRuntime>() {
|
||||||
let sessions = chat_runtime.get_sessions();
|
let sessions = chat_runtime.get_sessions();
|
||||||
if let Some(session) = sessions.first() {
|
if let Some(session) = sessions.first() {
|
||||||
let _ = chat::open_chat_window(tray.app_handle(), &session.ticket_id);
|
let _ = chat::open_chat_window(tray.app_handle(), &session.ticket_id, session.ticket_ref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue