mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-29 13:41:51 +02:00
Add more info to settings
This commit is contained in:
10
src-web/hooks/useAppInfo.ts
Normal file
10
src-web/hooks/useAppInfo.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import * as app from '@tauri-apps/api/app';
|
||||
import * as path from '@tauri-apps/api/path';
|
||||
|
||||
export function useAppInfo() {
|
||||
return useQuery(['appInfo'], async () => {
|
||||
const [version, appDataDir] = await Promise.all([app.getVersion(), path.appDataDir()]);
|
||||
return { version, appDataDir };
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user