diff options
Diffstat (limited to 'ui/src/state/models.ts')
| -rw-r--r-- | ui/src/state/models.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ui/src/state/models.ts b/ui/src/state/models.ts index 4ca79006..891f7a55 100644 --- a/ui/src/state/models.ts +++ b/ui/src/state/models.ts @@ -1,3 +1,4 @@ +import { invoke } from "@tauri-apps/api/core"; import Database from "@tauri-apps/plugin-sql"; export class User { @@ -122,9 +123,8 @@ interface Sync { export async function inspectCommandHistory( h: ShellHistory, ): Promise<InspectHistory> { - const db = await Database.load( - "sqlite:/Users/ellie/.local/share/atuin/history.db", - ); + const settings: Settings = await invoke("cli_settings"); + const db = await Database.load("sqlite:" + settings.db_path); let other: any[] = await db.select( "select * from history where command=?1 order by timestamp desc", @@ -151,9 +151,8 @@ export async function inspectCommandHistory( export async function inspectDirectoryHistory( h: ShellHistory, ): Promise<InspectHistory> { - const db = await Database.load( - "sqlite:/Users/ellie/.local/share/atuin/history.db", - ); + const settings: Settings = await invoke("cli_settings"); + const db = await Database.load("sqlite:" + settings.db_path); let other: any[] = await db.select( "select * from history where cwd=?1 order by timestamp desc", |
