Add more info to settings

This commit is contained in:
Gregory Schier
2024-02-17 11:04:19 -08:00
parent 72971bb9ec
commit 40dfc8b30a
14 changed files with 53 additions and 28 deletions

View 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 };
});
}

View File

@@ -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);
}

View File

@@ -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',