mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-21 00:49:17 +01: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 };
|
||||
});
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { getVersion } from '@tauri-apps/api/app';
|
||||
|
||||
export function useAppVersion() {
|
||||
return useQuery<string>(['appVersion'], getVersion);
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import { debounce } from '../lib/debounce';
|
||||
import { useOsInfo } from './useOsInfo';
|
||||
|
||||
export type HotkeyAction =
|
||||
| 'dropdown.close'
|
||||
| 'popup.close'
|
||||
| 'environmentEditor.toggle'
|
||||
| 'hotkeys.showHelp'
|
||||
| 'grpc_request.send'
|
||||
@@ -20,7 +20,7 @@ export type HotkeyAction =
|
||||
| 'urlBar.focus';
|
||||
|
||||
const hotkeys: Record<HotkeyAction, string[]> = {
|
||||
'dropdown.close': ['Escape'],
|
||||
'popup.close': ['Escape'],
|
||||
'environmentEditor.toggle': ['CmdCtrl+Shift+e'],
|
||||
'grpc_request.send': ['CmdCtrl+Enter', 'CmdCtrl+r'],
|
||||
'hotkeys.showHelp': ['CmdCtrl+Shift+/'],
|
||||
@@ -36,7 +36,7 @@ const hotkeys: Record<HotkeyAction, string[]> = {
|
||||
};
|
||||
|
||||
const hotkeyLabels: Record<HotkeyAction, string> = {
|
||||
'dropdown.close': 'Close Dropdown',
|
||||
'popup.close': 'Close Dropdown',
|
||||
'environmentEditor.toggle': 'Edit Environments',
|
||||
'grpc_request.send': 'Send Message',
|
||||
'hotkeys.showHelp': 'Show Keyboard Shortcuts',
|
||||
|
||||
Reference in New Issue
Block a user