fix(desktop): use correct store path in chat widgets
ChatWidget and ChatFloatingWidget were using relative path "machine-agent.json" instead of the full path with appLocalDataDir(). This caused "Maquina nao registrada" error in chat window. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
d00c59e0b5
commit
2f89fa33fe
2 changed files with 12 additions and 2 deletions
|
|
@ -2,9 +2,12 @@ import { useCallback, useEffect, useRef, useState } from "react"
|
|||
import { invoke } from "@tauri-apps/api/core"
|
||||
import { listen } from "@tauri-apps/api/event"
|
||||
import { Store } from "@tauri-apps/plugin-store"
|
||||
import { appLocalDataDir, join } from "@tauri-apps/api/path"
|
||||
import { Send, X, Minus, Loader2, Headphones } from "lucide-react"
|
||||
import type { ChatMessage, ChatMessagesResponse, SendMessageResponse } from "./types"
|
||||
|
||||
const STORE_FILENAME = "machine-agent.json"
|
||||
|
||||
interface ChatWidgetProps {
|
||||
ticketId: string
|
||||
}
|
||||
|
|
@ -34,7 +37,9 @@ export function ChatWidget({ ticketId }: ChatWidgetProps) {
|
|||
// Carregar configuracao do store
|
||||
const loadConfig = useCallback(async () => {
|
||||
try {
|
||||
const store = await Store.load("machine-agent.json")
|
||||
const appData = await appLocalDataDir()
|
||||
const storePath = await join(appData, STORE_FILENAME)
|
||||
const store = await Store.load(storePath)
|
||||
const token = await store.get<string>("token")
|
||||
const config = await store.get<{ apiBaseUrl: string }>("config")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue