()
| 18 | |
| 19 | useEffect(() => { |
| 20 | const getDbPath = async () => { |
| 21 | try { |
| 22 | // Use the Tauri command to get the correct database path |
| 23 | const { invoke } = await import('@tauri-apps/api/core'); |
| 24 | const path = await invoke<string>('get_db_path'); |
| 25 | console.log('[App] Database path:', path); |
| 26 | setDbPath(path); |
| 27 | } catch (err) { |
| 28 | console.error('Failed to resolve database path:', err); |
| 29 | setDbPath('./openllm_studio.db'); |
| 30 | } |
| 31 | }; |
| 32 | |
| 33 | getDbPath(); |
| 34 | }, []); |